summaryrefslogtreecommitdiffstats
path: root/sound/core/timer.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-04-10 09:43:08 +0800
committerTakashi Iwai <tiwai@suse.de>2009-04-14 12:39:12 +0200
commitef44a1ec6eeef189998f84e7230e1d3535b01074 (patch)
tree0baa5cc0bf27af13469c75bcb89cc55e448f45dd /sound/core/timer.c
parent577c9c456f0e1371cbade38eaf91ae8e8a308555 (diff)
downloadblackbird-op-linux-ef44a1ec6eeef189998f84e7230e1d3535b01074.tar.gz
blackbird-op-linux-ef44a1ec6eeef189998f84e7230e1d3535b01074.zip
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.c11
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;
OpenPOWER on IntegriCloud