mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 12:10:52 -04:00
V4L/DVB: IR/lirc: use memdup_user instead of copy_from_user
Signed-off-by: Jarod Wilson <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
parent
5690085e7b
commit
6efb870a11
1 changed files with 3 additions and 8 deletions
|
|
@ -74,14 +74,9 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char *buf,
|
|||
if (count > LIRCBUF_SIZE || count % 2 == 0)
|
||||
return -EINVAL;
|
||||
|
||||
txbuf = kzalloc(sizeof(int) * LIRCBUF_SIZE, GFP_KERNEL);
|
||||
if (!txbuf)
|
||||
return -ENOMEM;
|
||||
|
||||
if (copy_from_user(txbuf, buf, n)) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
txbuf = memdup_user(buf, n);
|
||||
if (IS_ERR(txbuf))
|
||||
return PTR_ERR(txbuf);
|
||||
|
||||
ir_dev = lirc->ir_dev;
|
||||
if (!ir_dev) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue