mtd: rawnand: mxs_nand: Ensure err is set for error path
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Fri, 1 Aug 2025 09:54:06 +0000 (10:54 +0100)
committerMichael Trimarchi <michael@amarulasolutions.com>
Sun, 3 Aug 2025 08:22:04 +0000 (10:22 +0200)
commit27242462167f678cb6ec78fa8c97f25c9557cb1e
tree91d59925f1c84dd13c40bb6b879472cf2f780611
parent2756de5213a1a88fae236d7be217c882b5daef9f
mtd: rawnand: mxs_nand: Ensure err is set for error path

In mxs_nand_init_ctrl there are a couple of error paths that do not set
err which could lead to the errors being silently ignored despite the
function not completing. Rather than just using if to detect these
errors use err to collect the error return value from the called
functions.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
drivers/mtd/nand/raw/mxs_nand.c