Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
0db188f9
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
163
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0db188f9
编写于
9月 29, 2017
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mtdchar: get rid of pointless access_ok()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
2ff7cfe9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
1 addition
and
23 deletion
+1
-23
drivers/mtd/mtdchar.c
drivers/mtd/mtdchar.c
+1
-23
未找到文件。
drivers/mtd/mtdchar.c
浏览文件 @
0db188f9
...
...
@@ -375,12 +375,7 @@ static int mtdchar_writeoob(struct file *file, struct mtd_info *mtd,
return
-
EINVAL
;
if
(
!
mtd
->
_write_oob
)
ret
=
-
EOPNOTSUPP
;
else
ret
=
access_ok
(
VERIFY_READ
,
ptr
,
length
)
?
0
:
-
EFAULT
;
if
(
ret
)
return
ret
;
return
-
EOPNOTSUPP
;
ops
.
ooblen
=
length
;
ops
.
ooboffs
=
start
&
(
mtd
->
writesize
-
1
);
...
...
@@ -419,9 +414,6 @@ static int mtdchar_readoob(struct file *file, struct mtd_info *mtd,
if
(
length
>
4096
)
return
-
EINVAL
;
if
(
!
access_ok
(
VERIFY_WRITE
,
ptr
,
length
))
return
-
EFAULT
;
ops
.
ooblen
=
length
;
ops
.
ooboffs
=
start
&
(
mtd
->
writesize
-
1
);
ops
.
datbuf
=
NULL
;
...
...
@@ -618,9 +610,6 @@ static int mtdchar_write_ioctl(struct mtd_info *mtd,
usr_data
=
(
const
void
__user
*
)(
uintptr_t
)
req
.
usr_data
;
usr_oob
=
(
const
void
__user
*
)(
uintptr_t
)
req
.
usr_oob
;
if
(
!
access_ok
(
VERIFY_READ
,
usr_data
,
req
.
len
)
||
!
access_ok
(
VERIFY_READ
,
usr_oob
,
req
.
ooblen
))
return
-
EFAULT
;
if
(
!
mtd
->
_write_oob
)
return
-
EOPNOTSUPP
;
...
...
@@ -662,21 +651,10 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg)
struct
mtd_info
*
mtd
=
mfi
->
mtd
;
void
__user
*
argp
=
(
void
__user
*
)
arg
;
int
ret
=
0
;
u_long
size
;
struct
mtd_info_user
info
;
pr_debug
(
"MTD_ioctl
\n
"
);
size
=
(
cmd
&
IOCSIZE_MASK
)
>>
IOCSIZE_SHIFT
;
if
(
cmd
&
IOC_IN
)
{
if
(
!
access_ok
(
VERIFY_READ
,
argp
,
size
))
return
-
EFAULT
;
}
if
(
cmd
&
IOC_OUT
)
{
if
(
!
access_ok
(
VERIFY_WRITE
,
argp
,
size
))
return
-
EFAULT
;
}
switch
(
cmd
)
{
case
MEMGETREGIONCOUNT
:
if
(
copy_to_user
(
argp
,
&
(
mtd
->
numeraseregions
),
sizeof
(
int
)))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录