From: Greg KH <gregkh@linuxfoundation.org>
To: Li Zhong <floridsleeves@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
jirislaby@kernel.org
Subject: Re: [PATCH v3] drivers/tty/serial: check the return value of uart_port_check()
Date: Sun, 4 Sep 2022 08:20:09 +0200 [thread overview]
Message-ID: <YxRDmX76WsjxuGzC@kroah.com> (raw)
In-Reply-To: <20220904004524.2281227-1-floridsleeves@gmail.com>
On Sat, Sep 03, 2022 at 05:45:24PM -0700, Li Zhong 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 because the locking does not guarantee
> the return value is not NULL. Here we do not need unlock in the error
> handling because the mutex_unlock() is called in callers.
>
> Signed-off-by: Li Zhong <floridsleeves@gmail.com>
> ---
>
> v3: Add the reason why we need to check the NULL value in the commit
> message. The bug is detected by static analysis.
Great, then please follow the rules in
Documentation/process/researcher-guidelines.rst and identify the tools
you are using as well as everything else listed there.
thanks,
greg k-h
next prev parent reply other threads:[~2022-09-04 6:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-04 0:45 [PATCH v3] drivers/tty/serial: check the return value of uart_port_check() Li Zhong
2022-09-04 6:20 ` Greg KH [this message]
2022-09-05 10:16 ` Ilpo Järvinen
-- strict thread matches above, loose matches on Subject: below --
2022-08-28 20:11 Li Zhong
2022-08-29 5:25 ` Greg KH
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=YxRDmX76WsjxuGzC@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=floridsleeves@gmail.com \
--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.