All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zheyu Ma <zheyuma97@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"jirislaby@kernel.org" <jirislaby@kernel.org>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4] tty: serial: jsm: allocate queue buffer at probe time
Date: Wed, 7 Jul 2021 18:37:52 +0800	[thread overview]
Message-ID: <CAMhUBjmsoB5zzqdqs5OKwqNa_twFwxu16pb+OTmUpTwW59sDfQ@mail.gmail.com> (raw)
In-Reply-To: <CAHp75Vdne2fVAdmMYPn71T8LnSNMxVhBVK8dbmMASTSTUnOjBA@mail.gmail.com>

On Wed, Jul 7, 2021 at 4:14 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
>
>
> On Monday, July 5, 2021, Zheyu Ma <zheyuma97@gmail.com> wrote:
>>
>> In function 'neo_intr', the driver uses 'ch->ch_equeue' and
>> 'ch->ch_reuque'. These two pointers are initialized in 'jsm_tty_open',
>> but the interrupt handler 'neo_intr' has been registered in the probe
>> progress. If 'jsm_tty_open' has not been called at this time, it will
>> cause null pointer dereference.
>>
>> Once the driver registers the interrupt handler, the driver should be
>> ready to handle it.
>>
>> Fix this by allocating the memory at probe time and not at open time.
>>
>> This log reveals it:
>
>
>
> When doing commit messages try to avoid tons of noise in them, I.e. here is _a lot of useless lines_ from the log, has to be addressed.

Thanks for your advice, I will learn from other commits.

Regards,
Zheyu Ma

      parent reply	other threads:[~2021-07-07 10:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05 12:53 [PATCH v4] tty: serial: jsm: allocate queue buffer at probe time Zheyu Ma
2021-07-07  7:49 ` Jiri Slaby
2021-07-07 12:28   ` Zheyu Ma
2021-07-07 12:52   ` Andy Shevchenko
2021-07-07 19:13     ` Jiri Slaby
2021-07-09 14:00       ` Zheyu Ma
2021-07-09 14:20         ` Greg Kroah-Hartman
2021-07-09 14:55           ` Zheyu Ma
     [not found] ` <CAHp75Vdne2fVAdmMYPn71T8LnSNMxVhBVK8dbmMASTSTUnOjBA@mail.gmail.com>
2021-07-07 10:37   ` Zheyu Ma [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMhUBjmsoB5zzqdqs5OKwqNa_twFwxu16pb+OTmUpTwW59sDfQ@mail.gmail.com \
    --to=zheyuma97@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.