This is a note to let you know that I've just added the patch titled
USB: usb_wwan: fix handling of missing bulk endpoints
to the 3.10-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-usb_wwan-fix-handling-of-missing-bulk-endpoints.patch
and it can be found in the queue-3.10 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From bd73bd8831696f189a479a0712ae95208e513d7e Mon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Thu, 3 Apr 2014 13:06:46 +0200
Subject: USB: usb_wwan: fix handling of missing bulk endpoints
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Johan Hovold <[email protected]>
commit bd73bd8831696f189a479a0712ae95208e513d7e upstream.
Fix regression introduced by commit 8e493ca1767d ("USB: usb_wwan: fix
bulk-urb allocation") by making sure to require both bulk-in and out
endpoints during port probe.
The original option driver (which usb_wwan is based on) was written
under the assumption that either endpoint could be missing, but
evidently this cannot have been tested properly. Specifically, it would
handle opening a device without bulk-in (but would blow up during resume
which was implemented later), but not a missing bulk-out in write()
(although it is handled in some places such as write_room()).
Fortunately (?), the driver also got the test for missing endpoints
wrong so the urbs were in fact always allocated, although they would be
initialised using the wrong endpoint address (0) and any submission of
such an urb would fail.
The commit mentioned above fixed the test for missing endpoints but
thereby exposed the other bugs which would now generate null-pointer
exceptions rather than failed urb submissions.
The regression was introduced in v3.7, but the offending commit was also
marked for stable.
Reported-by: Rafał Miłecki <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
Tested-by: Rafał Miłecki <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/usb/serial/usb_wwan.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -470,6 +470,9 @@ int usb_wwan_port_probe(struct usb_seria
int err;
int i;
+ if (!port->bulk_in_size || !port->bulk_out_size)
+ return -ENODEV;
+
portdata = kzalloc(sizeof(*portdata), GFP_KERNEL);
if (!portdata)
return -ENOMEM;
@@ -477,9 +480,6 @@ int usb_wwan_port_probe(struct usb_seria
init_usb_anchor(&portdata->delayed);
for (i = 0; i < N_IN_URB; i++) {
- if (!port->bulk_in_size)
- break;
-
buffer = (u8 *)__get_free_page(GFP_KERNEL);
if (!buffer)
goto bail_out_error;
@@ -493,9 +493,6 @@ int usb_wwan_port_probe(struct usb_seria
}
for (i = 0; i < N_OUT_URB; i++) {
- if (!port->bulk_out_size)
- break;
-
buffer = kmalloc(OUT_BUFLEN, GFP_KERNEL);
if (!buffer)
goto bail_out_error2;
Patches currently in stable-queue which might be from [email protected] are
queue-3.10/usb-option-driver-add-support-for-telit-ue910v2.patch
queue-3.10/usb-serial-ftdi_sio-add-id-for-brainboxes-serial-cards.patch
queue-3.10/usb-serial-fix-sysfs-attribute-removal-deadlock.patch
queue-3.10/usb-usb_wwan-fix-handling-of-missing-bulk-endpoints.patch
queue-3.10/usb-cp210x-add-8281-nanotec-plug-drive.patch
queue-3.10/revert-usb-serial-add-usbid-for-dell-wwan-card-to-sierra.c.patch
queue-3.10/usb-io_ti-fix-firmware-download-on-big-endian-machines.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