forked from Minki/linux
[um] hostaudio: don't open-code memdup_user()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
80f8dccf95
commit
1ceb36285c
@ -105,13 +105,9 @@ static ssize_t hostaudio_write(struct file *file, const char __user *buffer,
|
||||
printk(KERN_DEBUG "hostaudio: write called, count = %d\n", count);
|
||||
#endif
|
||||
|
||||
kbuf = kmalloc(count, GFP_KERNEL);
|
||||
if (kbuf == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
err = -EFAULT;
|
||||
if (copy_from_user(kbuf, buffer, count))
|
||||
goto out;
|
||||
kbuf = memdup_user(buffer, count);
|
||||
if (IS_ERR(kbuf))
|
||||
return PTR_ERR(kbuf);
|
||||
|
||||
err = os_write_file(state->fd, kbuf, count);
|
||||
if (err < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user