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

Next file: linux-2.4.20/drivers/i2c/i2c-keywest.c
Previous file: linux-2.4.20/drivers/i2c/i2c-core.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/drivers/i2c/i2c-dev.c linux-2.4.20/drivers/i2c/i2c-dev.c
@@ -159,6 +159,9 @@
 
 	struct i2c_client *client = (struct i2c_client *)file->private_data;
 
+	if(count > 8192)
+		count = 8192;
+		
 	/* copy user space data to kernel space. */
 	tmp = kmalloc(count,GFP_KERNEL);
 	if (tmp==NULL)
@@ -187,6 +190,9 @@
 	struct inode *inode = file->f_dentry->d_inode;
 #endif /* DEBUG */
 
+	if(count > 8192)
+		count = 8192;
+		
 	/* copy user space data to kernel space. */
 	tmp = kmalloc(count,GFP_KERNEL);
 	if (tmp==NULL)

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