From: Andrew Goodbody Date: Tue, 12 Aug 2025 11:34:39 +0000 (+0100) Subject: spi: cadence_qspi: Do not return unset error code X-Git-Tag: v2026.01-rc2~77^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a5129d3dafda90914972ce78db20f7eb6bc9fde;p=thirdparty%2Fu-boot.git spi: cadence_qspi: Do not return unset error code In spi_calibration if the low range fails to calibrate then the code attempted to return the variable err but this has not been set in this case. Instead just return -EIO. This issue was found by Smatch. Signed-off-by: Andrew Goodbody --- diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c index 9edbfaa821b..d8d9a4056fe 100644 --- a/drivers/spi/cadence_qspi.c +++ b/drivers/spi/cadence_qspi.c @@ -142,7 +142,7 @@ static int spi_calibration(struct udevice *bus, uint hz) if (range_lo == -1) { puts("SF: Calibration failed (low range)\n"); - return err; + return -EIO; } /* Disable QSPI for subsequent initialization */