aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/timer.c')
-rw-r--r--sound/core/timer.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 796532081e81..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;
@@ -1825,13 +1822,9 @@ static long snd_timer_user_ioctl(struct file *file, unsigned int cmd,
1825static int snd_timer_user_fasync(int fd, struct file * file, int on) 1822static int snd_timer_user_fasync(int fd, struct file * file, int on)
1826{ 1823{
1827 struct snd_timer_user *tu; 1824 struct snd_timer_user *tu;
1828 int err;
1829 1825
1830 tu = file->private_data; 1826 tu = file->private_data;
1831 err = fasync_helper(fd, file, on, &tu->fasync); 1827 return fasync_helper(fd, file, on, &tu->fasync);
1832 if (err < 0)
1833 return err;
1834 return 0;
1835} 1828}
1836 1829
1837static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, 1830static ssize_t snd_timer_user_read(struct file *file, char __user *buffer,