aboutsummaryrefslogtreecommitdiff
path: root/sound/isa/wavefront/wavefront_synth.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-04-10 09:43:36 +0800
committerTakashi Iwai <tiwai@suse.de>2009-04-14 12:39:23 +0200
commit68425adcc419bfe90776f59e66b8c4cdb6e1b1f3 (patch)
treeea68aa46121d17114732442d9730a22292606e46 /sound/isa/wavefront/wavefront_synth.c
parentef44a1ec6eeef189998f84e7230e1d3535b01074 (diff)
ALSA: sound/isa: 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/isa/wavefront/wavefront_synth.c')
-rw-r--r--sound/isa/wavefront/wavefront_synth.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c
index beb312cca75..5d4ff48c434 100644
--- a/sound/isa/wavefront/wavefront_synth.c
+++ b/sound/isa/wavefront/wavefront_synth.c
@@ -1664,12 +1664,11 @@ snd_wavefront_synth_ioctl (struct snd_hwdep *hw, struct file *file,
break;
case WFCTL_WFCMD:
- wc = kmalloc(sizeof(*wc), GFP_KERNEL);
- if (! wc)
- return -ENOMEM;
- if (copy_from_user (wc, argp, sizeof (*wc)))
- err = -EFAULT;
- else if (wavefront_synth_control (acard, wc) < 0)
+ wc = memdup_user(argp, sizeof(*wc));
+ if (IS_ERR(wc))
+ return PTR_ERR(wc);
+
+ if (wavefront_synth_control (acard, wc) < 0)
err = -EIO;
else if (copy_to_user (argp, wc, sizeof (*wc)))
err = -EFAULT;