summaryrefslogtreecommitdiff
path: root/sound/core/pcm_compat.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-04-10 05:43:08 +0400
committerTakashi Iwai <tiwai@suse.de>2009-04-14 14:39:12 +0400
commitef44a1ec6eeef189998f84e7230e1d3535b01074 (patch)
tree0baa5cc0bf27af13469c75bcb89cc55e448f45dd /sound/core/pcm_compat.c
parent577c9c456f0e1371cbade38eaf91ae8e8a308555 (diff)
downloadlinux-ef44a1ec6eeef189998f84e7230e1d3535b01074.tar.xz
ALSA: sound/core: 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/core/pcm_compat.c')
-rw-r--r--sound/core/pcm_compat.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c
index 36d7a5998234..08bfed594a83 100644
--- a/sound/core/pcm_compat.c
+++ b/sound/core/pcm_compat.c
@@ -232,14 +232,11 @@ static int snd_pcm_ioctl_hw_params_compat(struct snd_pcm_substream *substream,
if (! (runtime = substream->runtime))
return -ENOTTY;
- data = kmalloc(sizeof(*data), GFP_KERNEL);
- if (data == NULL)
- return -ENOMEM;
/* only fifo_size is different, so just copy all */
- if (copy_from_user(data, data32, sizeof(*data32))) {
- err = -EFAULT;
- goto error;
- }
+ data = memdup_user(data32, sizeof(*data32));
+ if (IS_ERR(data))
+ return PTR_ERR(data);
+
if (refine)
err = snd_pcm_hw_refine(substream, data);
else