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>
This commit is contained in:
Andrew Goodbody
2025-10-03 11:42:51 +01:00
committed by Heiko Schocher
parent d23ddd5dee
commit 51615eb4f7

View File

@@ -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;