mtd: spi-nor: Fix some error codes in cqspi_setup_flash()
Subsystems (3)
PATCH 2/2 mtd: spi-nor: Fix some error codes in cqspi_setup_flash()
We return success or possibly uninitialized values on these error paths instead of proper error codes.
drivers/mtd/spi-nor/cadence-quadspi.c +3 -1
@@ -1077,12 +1077,14 @@ static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np)/* Get flash device data */ for_each_available_child_of_node (dev->of_node, np) { -if (of_property_read_u32 (np,"reg" , &cs)) { + ret =of_property_read_u32 (np,"reg" , &cs); +if (ret) {dev_err (dev,"Couldn't determine chip select.\n" ); goto err; }if (cs >=CQSPI_MAX_CHIPSELECT ) { + ret = -EINVAL ;dev_err (dev,"Chip select %d out of range.\n" , cs); goto err; }
Quoted 6 lines · Dan Carpenter
We return success or possibly uninitialized values on these error paths instead of proper error codes.
Fixes 140623410536 ("mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller")Signed-off-by Dan Carpenter <[email protected]>
Nice
Quoted 21 lines
drivers/mtd/spi-nor/cadence-quadspi.c +3
-1@@ -1077,12 +1077,14 @@ static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np)/* Get flash device data */ for_each_available_child_of_node (dev->of_node, np) { -if (of_property_read_u32 (np,"reg" , &cs)) { + ret =of_property_read_u32 (np,"reg" , &cs); +if (ret) {dev_err (dev,"Couldn't determine chip select.\n" ); goto err; }if (cs >=CQSPI_MAX_CHIPSELECT ) { + ret = -EINVAL ;dev_err (dev,"Chip select %d out of range.\n" , cs); goto err; }
Signature · 2 lines
Best regards, Marek Vasut
Moritz Fischer
Reviewed-byQuoted 11 lines · Marek Vasut
Quoted 6 lines · Dan Carpenter
We return success or possibly uninitialized values on these error paths instead of proper error codes.
Fixes 140623410536 ("mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller")Signed-off-by Dan Carpenter <[email protected]>Nice
Reviewed-by Marek Vasut <[email protected]>
Thanks,
Moritz
Cyrille Pitchen
AppliedQuoted 5 lines · Moritz Fischer
Quoted 4 lines · Marek Vasut
Quoted 3 lines · Dan Carpenter
We return success or possibly uninitialized values on these error paths instead of proper error codes.
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
Fixes 140623410536 ("mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller")Signed-off-by Dan Carpenter <[email protected]>Nice
Reviewed-by Marek Vasut <[email protected]>Reviewed-by Moritz Fischer <[email protected]>
Applied to git://github.com/spi-nor/linux.git
Thanks!
Quoted 9 lines
Thanks,
Moritz
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html