Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: spi-nor: Kill check with no effect

header.minor is of type u8 and cannot be negative.

Detected by CoverityScan CID#1417858 ("Integer handling issues")

Fixes: f384b352cbf0 ("mtd: spi-nor: parse Serial Flash Discoverable
Parameters (SFDP) tables")
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>

authored by

Richard Weinberger and committed by
Cyrille Pitchen
90d4fa45 8a5776a5

+1 -2
+1 -2
drivers/mtd/spi-nor/spi-nor.c
··· 2288 2288 2289 2289 /* Check the SFDP header version. */ 2290 2290 if (le32_to_cpu(header.signature) != SFDP_SIGNATURE || 2291 - header.major != SFDP_JESD216_MAJOR || 2292 - header.minor < SFDP_JESD216_MINOR) 2291 + header.major != SFDP_JESD216_MAJOR) 2293 2292 return -EINVAL; 2294 2293 2295 2294 /*