Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284611
b: refs/heads/master
c: a699ed6
h: refs/heads/master
i:
  284609: a8e3047
  284607: ee516fc
v: v3
  • Loading branch information
Thomas Meyer authored and Jean Delvare committed Jan 12, 2012
1 parent c3a5125 commit 44e5211
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3527bd5045aacb4e4072f9cacb8eb9a433fbad39
refs/heads/master: a699ed6f1f977dcc4a49452a247cf21dc9cec3f9
13 changes: 4 additions & 9 deletions trunk/drivers/i2c/i2c-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,15 +251,10 @@ static noinline int i2cdev_ioctl_rdrw(struct i2c_client *client,
if (rdwr_arg.nmsgs > I2C_RDRW_IOCTL_MAX_MSGS)
return -EINVAL;

rdwr_pa = kmalloc(rdwr_arg.nmsgs * sizeof(struct i2c_msg), GFP_KERNEL);
if (!rdwr_pa)
return -ENOMEM;

if (copy_from_user(rdwr_pa, rdwr_arg.msgs,
rdwr_arg.nmsgs * sizeof(struct i2c_msg))) {
kfree(rdwr_pa);
return -EFAULT;
}
rdwr_pa = memdup_user(rdwr_arg.msgs,
rdwr_arg.nmsgs * sizeof(struct i2c_msg));
if (IS_ERR(rdwr_pa))
return PTR_ERR(rdwr_pa);

data_ptrs = kmalloc(rdwr_arg.nmsgs * sizeof(u8 __user *), GFP_KERNEL);
if (data_ptrs == NULL) {
Expand Down

0 comments on commit 44e5211

Please sign in to comment.