aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/jsm/jsm_neo.c
diff options
context:
space:
mode:
authorGuilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>2017-12-22 14:31:39 -0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-09 16:37:03 +0100
commite50af488dddea7754e581d69bf978356e468845c (patch)
tree193978b60735a8234130576da1de6688b7e2eb93 /drivers/tty/serial/jsm/jsm_neo.c
parenttty: serial: jsm: Remove unnecessary NULL checks (diff)
downloadlinux-dev-e50af488dddea7754e581d69bf978356e468845c.tar.xz
linux-dev-e50af488dddea7754e581d69bf978356e468845c.zip
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 <gpiccoli@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/jsm/jsm_neo.c')
-rw-r--r--drivers/tty/serial/jsm/jsm_neo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/tty/serial/jsm/jsm_neo.c b/drivers/tty/serial/jsm/jsm_neo.c
index 6fa9a54b2454..bf0e2a4cb0ce 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. */