summaryrefslogtreecommitdiff
path: root/sound/usb/usx2y/us122l.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-04-10 05:43:59 +0400
committerTakashi Iwai <tiwai@suse.de>2009-04-14 14:39:39 +0400
commit85385c1551d509e9e377b7be07ea0e755fb2c3ce (patch)
treebb60f13f32f2e4ec341f473475e7616f091125e9 /sound/usb/usx2y/us122l.c
parent68425adcc419bfe90776f59e66b8c4cdb6e1b1f3 (diff)
downloadlinux-85385c1551d509e9e377b7be07ea0e755fb2c3ce.tar.xz
ALSA: sound/usb: use memdup_user()
Remove open-coded memdup_user(). Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/usx2y/us122l.c')
-rw-r--r--sound/usb/usx2y/us122l.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c
index 98276aafefe6..012ff1f6f8af 100644
--- a/sound/usb/usx2y/us122l.c
+++ b/sound/usb/usx2y/us122l.c
@@ -349,14 +349,10 @@ static int usb_stream_hwdep_ioctl(struct snd_hwdep *hw, struct file *file,
if (cmd != SNDRV_USB_STREAM_IOCTL_SET_PARAMS)
return -ENOTTY;
- cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
- if (!cfg)
- return -ENOMEM;
+ cfg = memdup_user((void *)arg, sizeof(*cfg));
+ if (IS_ERR(cfg))
+ return PTR_ERR(cfg);
- if (copy_from_user(cfg, (void *)arg, sizeof(*cfg))) {
- err = -EFAULT;
- goto free;
- }
if (cfg->version != USB_STREAM_INTERFACE_VERSION) {
err = -ENXIO;
goto free;