git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 2.0 rc7
[linux-2.6.git]
/
drivers
/
mtd
/
mtdchar.c
diff --git
a/drivers/mtd/mtdchar.c
b/drivers/mtd/mtdchar.c
index
3792140
..
510ad78
100644
(file)
--- a/
drivers/mtd/mtdchar.c
+++ b/
drivers/mtd/mtdchar.c
@@
-285,12
+285,12
@@
static int mtd_ioctl(struct inode *inode, struct file *file,
size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT;
if (cmd & IOC_IN) {
size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT;
if (cmd & IOC_IN) {
- ret = verify_area(VERIFY_READ, argp, size);
-
if (ret) return ret
;
+ if (!access_ok(VERIFY_READ, argp, size))
+
return -EFAULT
;
}
if (cmd & IOC_OUT) {
}
if (cmd & IOC_OUT) {
- ret = verify_area(VERIFY_WRITE, argp, size);
-
if (ret) return ret
;
+ if (!access_ok(VERIFY_WRITE, argp, size))
+
return -EFAULT
;
}
switch (cmd) {
}
switch (cmd) {
@@
-389,7
+389,8
@@
static int mtd_ioctl(struct inode *inode, struct file *file,
if (!mtd->write_oob)
ret = -EOPNOTSUPP;
else
if (!mtd->write_oob)
ret = -EOPNOTSUPP;
else
- ret = verify_area(VERIFY_READ, buf.ptr, buf.length);
+ ret = access_ok(VERIFY_READ, buf.ptr,
+ buf.length) ? 0 : EFAULT;
if (ret)
return ret;
if (ret)
return ret;
@@
-428,7
+429,8
@@
static int mtd_ioctl(struct inode *inode, struct file *file,
if (!mtd->read_oob)
ret = -EOPNOTSUPP;
else
if (!mtd->read_oob)
ret = -EOPNOTSUPP;
else
- ret = verify_area(VERIFY_WRITE, buf.ptr, buf.length);
+ ret = access_ok(VERIFY_WRITE, buf.ptr,
+ buf.length) ? 0 : -EFAULT;
if (ret)
return ret;
if (ret)
return ret;