projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
80f8dcc
)
[um] hostaudio: don't open-code memdup_user()
author
Al Viro
<viro@zeniv.linux.org.uk>
Sat, 2 Jan 2016 19:50:51 +0000
(14:50 -0500)
committer
Al Viro
<viro@zeniv.linux.org.uk>
Mon, 4 Jan 2016 15:29:40 +0000
(10:29 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/um/drivers/hostaudio_kern.c
patch
|
blob
|
blame
|
history
diff --git
a/arch/um/drivers/hostaudio_kern.c
b/arch/um/drivers/hostaudio_kern.c
index f6b911cc3923a1958f9c393a94799a879c4aa8d9..3a4b58730f5fbcf45e8a586b2005e3b4b9688eda 100644
(file)
--- a/
arch/um/drivers/hostaudio_kern.c
+++ b/
arch/um/drivers/hostaudio_kern.c
@@
-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)