diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-04-10 09:43:08 +0800 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-04-14 12:39:12 +0200 |
commit | ef44a1ec6eeef189998f84e7230e1d3535b01074 (patch) | |
tree | 0baa5cc0bf27af13469c75bcb89cc55e448f45dd /sound/core/timer.c | |
parent | 577c9c456f0e1371cbade38eaf91ae8e8a308555 (diff) | |
download | op-kernel-dev-ef44a1ec6eeef189998f84e7230e1d3535b01074.zip op-kernel-dev-ef44a1ec6eeef189998f84e7230e1d3535b01074.tar.gz |
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 3f0050d..8f8b17a 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; |