OSDN Git Service

mtd: spi-nor: Kill check with no effect
authorRichard Weinberger <richard@nod.at>
Sun, 17 Sep 2017 14:13:52 +0000 (16:13 +0200)
committerCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
Tue, 10 Oct 2017 15:00:25 +0000 (17:00 +0200)
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>
drivers/mtd/spi-nor/spi-nor.c

index 19c0007..33f6fc1 100644 (file)
@@ -2288,8 +2288,7 @@ static int spi_nor_parse_sfdp(struct spi_nor *nor,
 
        /* Check the SFDP header version. */
        if (le32_to_cpu(header.signature) != SFDP_SIGNATURE ||
-           header.major != SFDP_JESD216_MAJOR ||
-           header.minor < SFDP_JESD216_MINOR)
+           header.major != SFDP_JESD216_MAJOR)
                return -EINVAL;
 
        /*