浏览代码

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>
Guilherme G. Piccoli 7 年之前
父节点
当前提交
e50af488dd
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      drivers/tty/serial/jsm/jsm_neo.c

+ 3 - 0
drivers/tty/serial/jsm/jsm_neo.c

@@ -1172,6 +1172,9 @@ static irqreturn_t neo_intr(int irq, void *voidbrd)
 				continue;
 				continue;
 
 
 			ch = brd->channels[port];
 			ch = brd->channels[port];
+			if (!ch)
+				continue;
+
 			neo_copy_data_from_uart_to_queue(ch);
 			neo_copy_data_from_uart_to_queue(ch);
 
 
 			/* Call our tty layer to enforce queue flow control if needed. */
 			/* Call our tty layer to enforce queue flow control if needed. */