提交 14f63eee 编写于 作者: H Haneen Mohammed 提交者: Greg Kroah-Hartman

Staging: media: Replace dev_err with pr_err to avoid null pointer derefrence

This patch replace dev_err with pr_err, for pointer is derefrenced after comparing it to NULL.
This was found using the following coccinelle script:

@disable is_null@
identifier f;
expression E;
identifier fld;
statement S;
@@

+ if(E == NULL) S
	f(...,E->fld,...);
-if(E == NULL) S;

@@
identifier f;
expression E;
identifier fld;
statement S;
@@

+ if(!E) S
	f(...,E->fld,...);
-if(!E) S;
Signed-off-by: NHaneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 cd25503f
......@@ -1341,8 +1341,7 @@ static int close(struct inode *node, struct file *filep)
struct IR *ir = filep->private_data;
if (ir == NULL) {
dev_err(ir->l.dev,
"close: no private_data attached to the file!\n");
pr_err("ir: close: no private_data attached to the file!\n");
return -ENODEV;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册