Re: [PATCH v3] drivers/tty/serial: check the return value of uart_port_check()

From: Greg KH
Date: Sun Sep 04 2022 - 02:20:24 EST


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@xxxxxxxxx>
> ---
>
> 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