patch-2.4.7 linux/drivers/i2c/i2c-dev.c

Next file: linux/drivers/i2o/i2o_block.c
Previous file: linux/drivers/char/w83877f_wdt.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.6/linux/drivers/i2c/i2c-dev.c linux/drivers/i2c/i2c-dev.c
@@ -241,6 +241,9 @@
 				   sizeof(rdwr_arg)))
 			return -EFAULT;
 
+		if(rdwr_arg.nmsgs > 2048)
+			return -EINVAL;
+			
 		rdwr_pa = (struct i2c_msg *)
 			kmalloc(rdwr_arg.nmsgs * sizeof(struct i2c_msg), 
 			GFP_KERNEL);

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