From: Guilherme G. Piccoli Date: Fri, 22 Dec 2017 16:31:39 +0000 (-0200) Subject: tty: serial: jsm: Add one check against NULL pointer dereference X-Git-Tag: v5.15~9512^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e50af488dddea7754e581d69bf978356e468845c;p=platform%2Fkernel%2Flinux-starfive.git tty: serial: jsm: Add one check against NULL pointer dereference All calls to neo_copy_data_from_uart_to_queue() are safeguarded against NULL dereference of its parameter, except the one that this patch changes. That said, let's play safe and check for NULL in this case too. Signed-off-by: Guilherme G. Piccoli Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/jsm/jsm_neo.c b/drivers/tty/serial/jsm/jsm_neo.c index 6fa9a54..bf0e2a4 100644 --- a/drivers/tty/serial/jsm/jsm_neo.c +++ b/drivers/tty/serial/jsm/jsm_neo.c @@ -1172,6 +1172,9 @@ static irqreturn_t neo_intr(int irq, void *voidbrd) continue; ch = brd->channels[port]; + if (!ch) + continue; + neo_copy_data_from_uart_to_queue(ch); /* Call our tty layer to enforce queue flow control if needed. */