Re: [PATCH] tty: serial: fsl_lpuart: potential NULL dereference
From: Greg Kroah-Hartman
Date: Sat Dec 10 2016 - 09:10:48 EST
On Sat, Dec 10, 2016 at 01:30:36AM +0300, Alexey Khoroshilov wrote:
> tty_port_tty_get() might return a tty which is NULL
> if the port is not associated with a tty
> (e.g. due to close or hangup).
> But lpuart_start_rx_dma() dereferences tty without any check.
Are you sure that tty could ever be NULL here? This function is only
called in places that seem to have a valid tty, with the maybe exception
of the resume call path. Can you audit this a bit better to be sure one
way or the other please?
thanks,
greg k-h