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:
38b9184
)
pstore/ram: Fix error return code in ramoops_probe()
author
Wang Yufen
<wangyufen@huawei.com>
Fri, 2 Dec 2022 08:22:54 +0000
(16:22 +0800)
committer
Kees Cook
<keescook@chromium.org>
Fri, 2 Dec 2022 23:16:59 +0000
(15:16 -0800)
In the if (dev_of_node(dev) && !pdata) path, the "err" may be assigned a
value of 0, so the error return code -EINVAL may be incorrectly set
to 0. To fix set valid return code before calling to goto.
Fixes:
35da60941e44
("pstore/ram: add Device Tree bindings")
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link:
https://lore.kernel.org/r/1669969374-46582-1-git-send-email-wangyufen@huawei.com
fs/pstore/ram.c
patch
|
blob
|
history
diff --git
a/fs/pstore/ram.c
b/fs/pstore/ram.c
index
5a39fa8
..
9a50524
100644
(file)
--- a/
fs/pstore/ram.c
+++ b/
fs/pstore/ram.c
@@
-745,6
+745,7
@@
static int ramoops_probe(struct platform_device *pdev)
/* Make sure we didn't get bogus platform data pointer. */
if (!pdata) {
pr_err("NULL platform data\n");
+ err = -EINVAL;
goto fail_out;
}
@@
-752,6
+753,7
@@
static int ramoops_probe(struct platform_device *pdev)
!pdata->ftrace_size && !pdata->pmsg_size)) {
pr_err("The memory size and the record/console size must be "
"non-zero\n");
+ err = -EINVAL;
goto fail_out;
}