diff options
Diffstat (limited to 'drivers/media/video/dabusb.c')
-rw-r--r-- | drivers/media/video/dabusb.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/media/video/dabusb.c b/drivers/media/video/dabusb.c index 0f505086774c..5b176bd7afdb 100644 --- a/drivers/media/video/dabusb.c +++ b/drivers/media/video/dabusb.c | |||
@@ -706,16 +706,11 @@ static long dabusb_ioctl (struct file *file, unsigned int cmd, unsigned long arg | |||
706 | switch (cmd) { | 706 | switch (cmd) { |
707 | 707 | ||
708 | case IOCTL_DAB_BULK: | 708 | case IOCTL_DAB_BULK: |
709 | pbulk = kmalloc(sizeof (bulk_transfer_t), GFP_KERNEL); | 709 | pbulk = memdup_user((void __user *)arg, |
710 | sizeof(bulk_transfer_t)); | ||
710 | 711 | ||
711 | if (!pbulk) { | 712 | if (IS_ERR(pbulk)) { |
712 | ret = -ENOMEM; | 713 | ret = PTR_ERR(pbulk); |
713 | break; | ||
714 | } | ||
715 | |||
716 | if (copy_from_user (pbulk, (void __user *) arg, sizeof (bulk_transfer_t))) { | ||
717 | ret = -EFAULT; | ||
718 | kfree (pbulk); | ||
719 | break; | 714 | break; |
720 | } | 715 | } |
721 | 716 | ||