diff options
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, | |||
1395 | struct list_head *p; | 1395 | struct list_head *p; |
1396 | int err = 0; | 1396 | int err = 0; |
1397 | 1397 | ||
1398 | ginfo = kmalloc(sizeof(*ginfo), GFP_KERNEL); | 1398 | ginfo = memdup_user(_ginfo, sizeof(*ginfo)); |
1399 | if (! ginfo) | 1399 | if (IS_ERR(ginfo)) |
1400 | return -ENOMEM; | 1400 | return PTR_ERR(ginfo); |
1401 | if (copy_from_user(ginfo, _ginfo, sizeof(*ginfo))) { | 1401 | |
1402 | kfree(ginfo); | ||
1403 | return -EFAULT; | ||
1404 | } | ||
1405 | tid = ginfo->tid; | 1402 | tid = ginfo->tid; |
1406 | memset(ginfo, 0, sizeof(*ginfo)); | 1403 | memset(ginfo, 0, sizeof(*ginfo)); |
1407 | ginfo->tid = tid; | 1404 | ginfo->tid = tid; |