drivers/usb/serial/mos7720.c: inconsequent NULL checking

Adrian Bunk <[email protected]>
Newsgroups gmane.linux.usb.devel,gmane.linux.kernel
Message-ID <[email protected]>
The Coverity checker noted the following inconsequent NULL checking in 
drivers/usb/serial/mos7720.c:

<--  snip  -->

...
static void mos7720_close(struct usb_serial_port *port, struct file *filp)
{
...

        /* While closing port, shutdown all bulk read, write  *
         * and interrupt read if they exists                  */
        if (serial->dev) {
                dbg("Shutdown bulk write");
                usb_kill_urb(port->write_urb);
                dbg("Shutdown bulk read");
                usb_kill_urb(port->read_urb);
        }

        data = 0x00;
        send_mos_cmd(serial, MOS_WRITE, port->number - port->serial->minor,
                     0x04, &data);
...

<--  snip  -->

Note that "send_mos_cmd(serial,...)" dereferences "serial->dev".

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.