summaryrefslogtreecommitdiff
path: root/drivers/media/IR
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2010-07-16 21:29:54 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-02 19:42:56 (GMT)
commit6efb870a115ac223ab578bc76699ba8591250568 (patch)
tree769d2b4bad3e3c82e7eee654577fb55ac7a191ae /drivers/media/IR
parent5690085e7ba7f3081c6ab6db3a3b543444ad8a21 (diff)
downloadlinux-fsl-qoriq-6efb870a115ac223ab578bc76699ba8591250568.tar.xz
V4L/DVB: IR/lirc: use memdup_user instead of copy_from_user
Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR')
-rw-r--r--drivers/media/IR/ir-lirc-codec.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/media/IR/ir-lirc-codec.c b/drivers/media/IR/ir-lirc-codec.c
index afb1ada..ee1f2d4 100644
--- a/drivers/media/IR/ir-lirc-codec.c
+++ b/drivers/media/IR/ir-lirc-codec.c
@@ -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) {