diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-04-10 05:43:08 +0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-04-14 14:39:12 +0400 |
commit | ef44a1ec6eeef189998f84e7230e1d3535b01074 (patch) | |
tree | 0baa5cc0bf27af13469c75bcb89cc55e448f45dd /sound/core/timer.c | |
parent | 577c9c456f0e1371cbade38eaf91ae8e8a308555 (diff) | |
download | linux-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/timer.c')
-rw-r--r-- | sound/core/timer.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sound/core/timer.c b/sound/core/timer.c index 3f0050d0b71e..8f8b17ac074d 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -1395,13 +1395,10 @@ static int snd_timer_user_ginfo(struct file *file, struct list_head *p; int err = 0; - ginfo = kmalloc(sizeof(*ginfo), GFP_KERNEL); - if (! ginfo) - return -ENOMEM; - if (copy_from_user(ginfo, _ginfo, sizeof(*ginfo))) { - kfree(ginfo); - return -EFAULT; - } + ginfo = memdup_user(_ginfo, sizeof(*ginfo)); + if (IS_ERR(ginfo)) + return PTR_ERR(ginfo); + tid = ginfo->tid; memset(ginfo, 0, sizeof(*ginfo)); ginfo->tid = tid; |