projects
/
GitHub
/
moto-9609
/
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:
8ed6010
)
rsxx: don't open-code memdup_user()
author
Al Viro
<viro@zeniv.linux.org.uk>
Sat, 2 Jan 2016 19:58:07 +0000
(14:58 -0500)
committer
Al Viro
<viro@zeniv.linux.org.uk>
Wed, 6 Jan 2016 13:25:24 +0000
(08:25 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/block/rsxx/core.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/block/rsxx/core.c
b/drivers/block/rsxx/core.c
index d8b2488aaade109847a3b9156e1279b112907c14..34997df132e240be4bcebedcf0df6c6baaf39907 100644
(file)
--- a/
drivers/block/rsxx/core.c
+++ b/
drivers/block/rsxx/core.c
@@
-203,14
+203,11
@@
static ssize_t rsxx_cram_write(struct file *fp, const char __user *ubuf,
char *buf;
ssize_t st;
- buf =
kzalloc(cnt, GFP_KERNEL
);
- if (
!buf
)
- return
-ENOMEM
;
+ buf =
memdup_user(ubuf, cnt
);
+ if (
IS_ERR(buf)
)
+ return
PTR_ERR(buf)
;
- st = copy_from_user(buf, ubuf, cnt);
- if (!st)
- st = rsxx_creg_write(card, CREG_ADD_CRAM + (u32)*ppos, cnt,
- buf, 1);
+ st = rsxx_creg_write(card, CREG_ADD_CRAM + (u32)*ppos, cnt, buf, 1);
kfree(buf);
if (st)
return st;