diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-04-09 21:43:08 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-04-14 06:39:12 -0400 |
commit | ef44a1ec6eeef189998f84e7230e1d3535b01074 (patch) | |
tree | 0baa5cc0bf27af13469c75bcb89cc55e448f45dd /sound/core/pcm_compat.c | |
parent | 577c9c456f0e1371cbade38eaf91ae8e8a308555 (diff) |
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.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c index 36d7a599823..08bfed594a8 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, | |||
232 | if (! (runtime = substream->runtime)) | 232 | if (! (runtime = substream->runtime)) |
233 | return -ENOTTY; | 233 | return -ENOTTY; |
234 | 234 | ||
235 | data = kmalloc(sizeof(*data), GFP_KERNEL); | ||
236 | if (data == NULL) | ||
237 | return -ENOMEM; | ||
238 | /* only fifo_size is different, so just copy all */ | 235 | /* only fifo_size is different, so just copy all */ |
239 | if (copy_from_user(data, data32, sizeof(*data32))) { | 236 | data = memdup_user(data32, sizeof(*data32)); |
240 | err = -EFAULT; | 237 | if (IS_ERR(data)) |
241 | goto error; | 238 | return PTR_ERR(data); |
242 | } | 239 | |
243 | if (refine) | 240 | if (refine) |
244 | err = snd_pcm_hw_refine(substream, data); | 241 | err = snd_pcm_hw_refine(substream, data); |
245 | else | 242 | else |