patch-2.4.19 linux-2.4.19/drivers/usb/rio500.c

Next file: linux-2.4.19/drivers/usb/rtl8150.c
Previous file: linux-2.4.19/drivers/usb/pwc.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.18/drivers/usb/rio500.c linux-2.4.19/drivers/usb/rio500.c
@@ -141,7 +141,7 @@
 			retval = -EFAULT;
 			goto err_out;
 		}
-		if (rio_cmd.length > PAGE_SIZE) {
+		if (rio_cmd.length < 0 || rio_cmd.length > PAGE_SIZE) {
 			retval = -EINVAL;
 			goto err_out;
 		}
@@ -211,7 +211,7 @@
 			retval = -EFAULT;
 			goto err_out;
 		}
-		if (rio_cmd.length > PAGE_SIZE) {
+		if (rio_cmd.length < 0 || rio_cmd.length > PAGE_SIZE) {
 			retval = -EINVAL;
 			goto err_out;
 		}

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