Message ID | be56c41b-0b29-de40-0bce-700de64b7d92@users.sourceforge.net |
---|---|
State | New |
Headers | show |
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c index 66f323f..6d8226d 100644 --- a/drivers/i2c/i2c-dev.c +++ b/drivers/i2c/i2c-dev.c @@ -260,7 +260,9 @@ static noinline int i2cdev_ioctl_rdwr(struct i2c_client *client, if (IS_ERR(rdwr_pa)) return PTR_ERR(rdwr_pa); - data_ptrs = kmalloc(rdwr_arg.nmsgs * sizeof(u8 __user *), GFP_KERNEL); + data_ptrs = kmalloc_array(rdwr_arg.nmsgs, + sizeof(*data_ptrs), + GFP_KERNEL); if (data_ptrs == NULL) { kfree(rdwr_pa); return -ENOMEM;