summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Goodbody <andrew.goodbody@linaro.org>2025-10-03 11:42:51 +0100
committerHeiko Schocher <hs@nabladev.com>2025-10-08 11:36:00 +0200
commit51615eb4f7bcd3367aecdeaea3638058ef5407f3 (patch)
tree756b65824f8562716f111079a4ca6a4bafe3df1a
parentd23ddd5dee570e625e0fd76bba1e155f4cc1248c (diff)
fs: ubifs: Need to check return for being an error pointer
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>
-rw-r--r--fs/ubifs/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 7718081f093..b6004b88f4e 100644
--- 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;