git.openpandora.org
/
pandora-u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d23ddd5
)
fs: ubifs: Need to check return for being an error pointer
author
Andrew Goodbody
<andrew.goodbody@linaro.org>
Fri, 3 Oct 2025 10:42:51 +0000
(11:42 +0100)
committer
Heiko Schocher
<hs@nabladev.com>
Wed, 8 Oct 2025 09:36:00 +0000
(11:36 +0200)
The return value from alloc_super can be an error pointer so the error
check needs to detect this as well as checking the pointer for being
NULL.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
fs/ubifs/super.c
patch
|
blob
|
history
diff --git
a/fs/ubifs/super.c
b/fs/ubifs/super.c
index
7718081
..
b6004b8
100644
(file)
--- a/
fs/ubifs/super.c
+++ b/
fs/ubifs/super.c
@@
-2425,7
+2425,7
@@
retry:
if (!s) {
spin_unlock(&sb_lock);
s = alloc_super(type, flags);
- if (
!s
)
+ if (
IS_ERR_OR_NULL(s)
)
return ERR_PTR(-ENOMEM);
#ifndef __UBOOT__
goto retry;