]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mtd: sharpslpart: Fix unsigned comparison to zero
authorYueHaibing <yuehaibing@huawei.com>
Mon, 30 Dec 2019 03:29:45 +0000 (11:29 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 21 Jan 2020 19:00:34 +0000 (20:00 +0100)
commitf33113b542219448fa02d77ca1c6f4265bd7f130
treef91752cec049cae48bf7226ebbdd7e460dded248
parent05a5a6e57e6aebdab588d47acc8643e566c170fa
mtd: sharpslpart: Fix unsigned comparison to zero

The unsigned variable log_num is being assigned a return value
from the call to sharpsl_nand_get_logical_num that can return
-EINVAL.

Detected using Coccinelle:
./drivers/mtd/parsers/sharpslpart.c:207:6-13: WARNING: Unsigned expression compared with zero: log_num > 0

Fixes: 8a4580e4d298 ("mtd: sharpslpart: Add sharpslpart partition parser")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/parsers/sharpslpart.c