diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-04-10 01:43:36 (GMT) |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-04-14 10:39:23 (GMT) |
commit | 68425adcc419bfe90776f59e66b8c4cdb6e1b1f3 (patch) | |
tree | ea68aa46121d17114732442d9730a22292606e46 /sound/isa/wavefront/wavefront_synth.c | |
parent | ef44a1ec6eeef189998f84e7230e1d3535b01074 (diff) | |
download | linux-68425adcc419bfe90776f59e66b8c4cdb6e1b1f3.tar.xz |
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.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c index beb312c..5d4ff48 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; |