diff options
author | Haneen Mohammed <hamohammed.sa@gmail.com> | 2015-03-06 20:01:07 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-06 15:54:41 -0800 |
commit | 14f63eeecfa3ca092f1c83755303161e53a9c641 (patch) | |
tree | 46ff6daace6515a873b4ddf17ba7395c111b053e /drivers/staging/media | |
parent | cd25503f5a6f0b0d6d66185461a358e8218db745 (diff) | |
download | op-kernel-dev-14f63eeecfa3ca092f1c83755303161e53a9c641.zip op-kernel-dev-14f63eeecfa3ca092f1c83755303161e53a9c641.tar.gz |
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: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/media')
-rw-r--r-- | drivers/staging/media/lirc/lirc_zilog.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_zilog.c index e16627c..261e27d 100644 --- a/drivers/staging/media/lirc/lirc_zilog.c +++ b/drivers/staging/media/lirc/lirc_zilog.c @@ -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; } |