lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 23 Jul 2007 03:51:28 +0200
From:	Adrian Bunk <bunk@...sta.de>
To:	Oliver Neukum <oneukum@...e.de>,
	Greg Kroah-Hartman <gregkh@...e.de>
Cc:	linux-usb-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: usb_serial_suspend(): buggy(?) code

Commit ec22559e0b7a05283a3413bda5d177e42c950e23 added the following 
function to drivers/usb/serial/usb-serial.c:

<--  snip  -->

...
int usb_serial_suspend(struct usb_interface *intf, pm_message_t message)
{
        struct usb_serial *serial = usb_get_intfdata(intf);
        struct usb_serial_port *port;
        int i, r = 0;

        if (serial) {
                for (i = 0; i < serial->num_ports; ++i) {
                        port = serial->port[i];
                        if (port)
                                kill_traffic(port);
                }
        }

        if (serial->type->suspend)
                serial->type->suspend(serial, message);

        return r;
}
...

<--  snip  -->

The Coverity checker spotted the inconsequent NULL checking for "serial".

Looking at the code it also doesn't seem to have been intended to always 
return 0.

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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ