Commit 820351f0 authored by Al Viro's avatar Al Viro

rsxx: don't open-code memdup_user()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 8ed6010d
...@@ -203,14 +203,11 @@ static ssize_t rsxx_cram_write(struct file *fp, const char __user *ubuf, ...@@ -203,14 +203,11 @@ static ssize_t rsxx_cram_write(struct file *fp, const char __user *ubuf,
char *buf; char *buf;
ssize_t st; ssize_t st;
buf = kzalloc(cnt, GFP_KERNEL); buf = memdup_user(ubuf, cnt);
if (!buf) if (IS_ERR(buf))
return -ENOMEM; return PTR_ERR(buf);
st = copy_from_user(buf, ubuf, cnt); st = rsxx_creg_write(card, CREG_ADD_CRAM + (u32)*ppos, cnt, buf, 1);
if (!st)
st = rsxx_creg_write(card, CREG_ADD_CRAM + (u32)*ppos, cnt,
buf, 1);
kfree(buf); kfree(buf);
if (st) if (st)
return st; return st;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment