All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Li Zhong <floridsleeves@gmail.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>
Subject: Re: [PATCH v2] drivers/tty/serial: check the return value of uart_port_check()
Date: Mon, 29 Aug 2022 10:09:25 +0300 (EEST)	[thread overview]
Message-ID: <2033d06d-10a4-5a57-d650-7541c39990ee@linux.intel.com> (raw)
In-Reply-To: <CAMEuxRqBEMdva3qEphvuYkFLpRjp=xg7vpqQT1oqb2AgkkG2+w@mail.gmail.com>

On Sun, 28 Aug 2022, Li Zhong wrote:

> On Fri, Aug 26, 2022 at 9:01 AM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> >
> > On Fri, Aug 26, 2022 at 11:38 AM Li Zhong <floridsleeves@gmail.com> wrote:
> > >
> > > uart_port_check() will return NULL pointer when state->uart_port is
> > > NULL. Check the return value before dereference it to avoid
> > > null-pointer-dereference error.
> >
> > Have you taken the locking into consideration?
> > If no, please do, if yes, expand your commit message to explain why
> > the current locking scheme doesn't prevent an error from happening.
> >
> 
> The locking is taken into consideration but these three checks do not need to
> unlock in error-handling because unlock() will be called in the callers. Will
> add the comment in v2 patch.

I think he meant you should indicate why the current locking doesn't cover 
the case you're fixing, not whether this function should call unlock() or 
not.

-- 
 i.


  reply	other threads:[~2022-08-29  7:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26  8:36 [PATCH v2] drivers/tty/serial: check the return value of uart_port_check() Li Zhong
2022-08-26 16:01 ` Andy Shevchenko
2022-08-28 19:57   ` Li Zhong
2022-08-29  7:09     ` Ilpo Järvinen [this message]
2022-08-30  6:59       ` Li Zhong
2022-08-30  7:20         ` Ilpo Järvinen
2022-09-03 23:14           ` Li Zhong

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=2033d06d-10a4-5a57-d650-7541c39990ee@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=floridsleeves@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.