projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb3b5ab
)
misc: tizen-inform-reboot: fix a potential NULL pointer dereference
81/256981/1
accepted/tizen/unified/20210416.143418
submit/tizen/20210416.024334
author
Jaehoon Chung
<jh80.chung@samsung.com>
Fri, 16 Apr 2021 02:18:41 +0000
(11:18 +0900)
committer
Jaehoon Chung
<jh80.chung@samsung.com>
Fri, 16 Apr 2021 02:18:41 +0000
(11:18 +0900)
Fix a potential NULL pointer dereference.
If there is no file or directory, it has to check whether it's error or
not.
Change-Id: Ia6e7280c1901ae772a5f890c312b7a741fbac0a1
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/misc/tizen-inform-reboot.c
patch
|
blob
|
history
diff --git
a/drivers/misc/tizen-inform-reboot.c
b/drivers/misc/tizen-inform-reboot.c
index
386c1f6
..
02f82bb
100644
(file)
--- a/
drivers/misc/tizen-inform-reboot.c
+++ b/
drivers/misc/tizen-inform-reboot.c
@@
-29,7
+29,7
@@
static int inform_reboot_notifier(struct notifier_block *nb,
set_fs(KERNEL_DS);
file = filp_open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0644);
- if (
file
) {
+ if (
!IS_ERR(file)
) {
struct super_block *sb = file->f_path.dentry->d_sb;
if (cmd) {