[patch 25/28] USB: cdc-acm: fix sysfs attribute registration bug

Greg KH <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.usb.devel
Message-ID <[email protected]>
usb-cdc-acm-fix-sysfs-attribute-registration-bug.patch (text/plain, 1.1 KB)
-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Alan Stern <[email protected]>

This patch (as950) fixes a bug in the cdc-acm driver.  It doesn't keep
track of which interface (control or data) the sysfs attributes get
registered for, and as a result, during disconnect it will sometimes
attempt to remove the attributes from the wrong interface.  The
left-over attributes can cause a crash later on, particularly if the driver
module has been unloaded.

Signed-off-by: Alan Stern <[email protected]>
Acked-by: Oliver Neukum <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/usb/class/cdc-acm.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -900,6 +900,10 @@ next_desc:
 			return -ENODEV;
 		}
 	}
+
+	/* Accept probe requests only for the control interface */
+	if (intf != control_interface)
+		return -ENODEV;
 	
 	if (data_interface_num != call_interface_num)
 		dev_dbg(&intf->dev,"Seperate call control interface. That is not fully supported.");

--
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.