[bug report] serial-uartlite: Do not use static struct uart_driver out of probe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Shubhrajyoti Datta,

This is a semi-automatic email about new static checker warnings.

The patch 3b209d253e7f: "serial-uartlite: Do not use static struct 
uart_driver out of probe()" from Oct 16, 2018, leads to the following 
Smatch complaint:

    drivers/tty/serial/uartlite.c:720 ulite_suspend()
     warn: variable dereferenced before check 'port' (see line 718)

drivers/tty/serial/uartlite.c
   717		struct uart_port *port = dev_get_drvdata(dev);
   718		struct uartlite_data *pdata = port->private_data;
                                              ^^^^^^^^^^^^^^^^^^
The patch adds an unchecked dereference.

   719	
   720		if (port)
                    ^^^^
Checked too late.  Presumably this NULL check is can be deleted?

   721			uart_suspend_port(pdata->ulite_uart_driver, port);
   722	

regards,
dan carpenter



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux