Discussion:
[Bugme-new] [Bug 9572] New: Dereferencing NULL pointer on drivers/usb/serial/mos7720.c
Andrew Morton
2007-12-16 04:23:27 UTC
Permalink
http://bugzilla.kernel.org/show_bug.cgi?id=9572
Summary: Dereferencing NULL pointer on
drivers/usb/serial/mos7720.c
Product: Drivers
Version: 2.5
KernelVersion: 2.6.23
Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: USB
There is a NULL pointer dereference on drivers/usb/serial/mos7720.c
(1) line 568: there's a test "if (serial->dev)" implying that
null is a legal value for "serial->dev" at that point
(2) line 576: "serial" is passed in as an argument to "send_mos_cmd"
(3) line 282: "send_mos_cmd" unconditionally dereferences serial->dev
at expression "le16_to_cpu(serial->dev->descriptor.idProduct)
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
linux-usb-***@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Oliver Neukum
2007-12-20 10:48:32 UTC
Permalink
http://bugzilla.kernel.org/show_bug.cgi?id=9572
Summary: Dereferencing NULL pointer on
drivers/usb/serial/mos7720.c
Product: Drivers
Version: 2.5
KernelVersion: 2.6.23
Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: USB
There is a NULL pointer dereference on drivers/usb/serial/mos7720.c
(1) line 568: there's a test "if (serial->dev)" implying that
null is a legal value for "serial->dev" at that point
(2) line 576: "serial" is passed in as an argument to "send_mos_cmd"
(3) line 282: "send_mos_cmd" unconditionally dereferences serial->dev
at expression "le16_to_cpu(serial->dev->descriptor.idProduct)
I see no way serial->dev may become NULL. The test looks superfluous.
Did you get an oops or is this result of a checking tool?

Regards
Oliver

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
linux-usb-***@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Loading...