This is a note to let you know that I've just added the patch titled
USB: cdc-wdm: fix wdm_find_device* return value
to the 3.5-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
usb-cdc-wdm-fix-wdm_find_device-return-value.patch
and it can be found in the queue-3.5 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From 6a44886899ef8cc396e230e492e6a56a883889f3 Mon Sep 17 00:00:00 2001
From: Bjørn Mork <[email protected]>
Date: Mon, 10 Sep 2012 22:17:34 +0200
Subject: USB: cdc-wdm: fix wdm_find_device* return value
From: Bjørn Mork <[email protected]>
commit 6a44886899ef8cc396e230e492e6a56a883889f3 upstream.
A logic error made the wdm_find_device* functions
return a bogus pointer into static data instead of
the intended NULL no matching device was found.
Signed-off-by: Bjørn Mork <[email protected]>
Cc: Oliver Neukum <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/usb/class/cdc-wdm.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -134,12 +134,14 @@ static struct usb_driver wdm_driver;
/* return intfdata if we own the interface, else look up intf in the list */
static struct wdm_device *wdm_find_device(struct usb_interface *intf)
{
- struct wdm_device *desc = NULL;
+ struct wdm_device *desc;
spin_lock(&wdm_device_list_lock);
list_for_each_entry(desc, &wdm_device_list, device_list)
if (desc->intf == intf)
- break;
+ goto found;
+ desc = NULL;
+found:
spin_unlock(&wdm_device_list_lock);
return desc;
@@ -147,12 +149,14 @@ static struct wdm_device *wdm_find_devic
static struct wdm_device *wdm_find_device_by_minor(int minor)
{
- struct wdm_device *desc = NULL;
+ struct wdm_device *desc;
spin_lock(&wdm_device_list_lock);
list_for_each_entry(desc, &wdm_device_list, device_list)
if (desc->intf->minor == minor)
- break;
+ goto found;
+ desc = NULL;
+found:
spin_unlock(&wdm_device_list_lock);
return desc;
Patches currently in stable-queue which might be from [email protected] are
queue-3.5/net-usbnet-fix-softirq-storm-on-suspend.patch
queue-3.5/usb-option-replace-zte-k5006-z-entry-with-vendor-class-rule.patch
queue-3.5/usb-ftdi_sio-do-not-claim-cdc-acm-function.patch
queue-3.5/kobject-fix-oops-with-input0-bad-kobj_uevent_env-content-in-show_uevent.patch
queue-3.5/usb-cdc-wdm-fix-wdm_find_device-return-value.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html