patch-2.4.22 linux-2.4.22/drivers/usb/usb.c

Next file: linux-2.4.22/drivers/usb/usbnet.c
Previous file: linux-2.4.22/drivers/usb/storage/usb.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/drivers/usb/usb.c linux-2.4.22/drivers/usb/usb.c
@@ -2154,7 +2154,7 @@
 		if (err < 0) {
 			err("error getting string descriptor 0 (error=%d)", err);
 			goto errout;
-		} else if (tbuf[0] < 4) {
+		} else if (err < 4 || tbuf[0] < 4) {
 			err("string descriptor 0 too short");
 			err = -EINVAL;
 			goto errout;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)