On Mon, Aug 22, 2022 at 10:57:39PM -0700, lily wrote:
> uart_port_check() can return NULL pointer.
It can? How will that happen?
> Check its return value
> before dereference it.
How do you trigger this issue, and how was this change you made tested?
thanks,
greg k-h
On Mon, Aug 22, 2022 at 11:20 PM Greg KH <[email protected]> wrote:
>
> On Mon, Aug 22, 2022 at 10:57:39PM -0700, lily wrote:
> > uart_port_check() can return NULL pointer.
>
> It can? How will that happen?
>
When state->uart_port is NULL, uart_port_check() will return a NULL pointer.
This actually is checked in other places like
drivers/tty/serial/serial_core.c:762.
> > Check its return value before dereference it.
>
> How do you trigger this issue, and how was this change you made tested?
>
I detect this issue with a static analysis tool, therefore not dynamically
triggered.
> thanks,
>
> greg k-h