projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
820351f
)
cdrom: don't open-code memdup_user()
author
Al Viro
<viro@zeniv.linux.org.uk>
Sat, 2 Jan 2016 19:59:38 +0000
(14:59 -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/cdrom/cdrom.c
patch
|
blob
|
history
diff --git
a/drivers/cdrom/cdrom.c
b/drivers/cdrom/cdrom.c
index c206ccda899b388fe7856424078c505f99c87830..1b257ea9776ae596ed3164bc11a37d325c47d989 100644
(file)
--- a/
drivers/cdrom/cdrom.c
+++ b/
drivers/cdrom/cdrom.c
@@
-3186,15
+3186,11
@@
static noinline int mmc_ioctl_dvd_read_struct(struct cdrom_device_info *cdi,
if (!CDROM_CAN(CDC_DVD))
return -ENOSYS;
- s =
kmalloc(size, GFP_KERNEL
);
- if (
!s
)
- return
-ENOMEM
;
+ s =
memdup_user(arg, size
);
+ if (
IS_ERR(s)
)
+ return
PTR_ERR(s)
;
cd_dbg(CD_DO_IOCTL, "entering DVD_READ_STRUCT\n");
- if (copy_from_user(s, arg, size)) {
- kfree(s);
- return -EFAULT;
- }
ret = dvd_read_struct(cdi, s, cgc);
if (ret)