Skip to content
Unverified Commit 3e9e38d9 authored by Dan Carpenter's avatar Dan Carpenter Committed by Tudor Ambarus
Browse files

mtd: spi-nor: Fix an error code in spi_nor_read_raw()



The problem is that if "ret" is negative then when we check if
"ret > len", that condition is going to be true because of type
promotion.  So this patch re-orders the code to check for negatives
first and preserve those error codes.

Fixes: f384b352 ("mtd: spi-nor: parse Serial Flash Discoverable Parameters (SFDP) tables")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarTudor Ambarus <tudor.ambarus@microchip.com>
parent 4262ee88
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment