LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* drivers/usb/serial/mos7720.c: inconsequent NULL checking
@ 2007-02-06 22:13 Adrian Bunk
  0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2007-02-06 22:13 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb-devel, linux-kernel

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* drivers/usb/serial/mos7720.c: inconsequent NULL checking
@ 2006-11-11 16:22 Adrian Bunk
  0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2006-11-11 16:22 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb-devel, linux-kernel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-06 22:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-06 22:13 drivers/usb/serial/mos7720.c: inconsequent NULL checking Adrian Bunk
  -- strict thread matches above, loose matches on Subject: below --
2006-11-11 16:22 Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).