]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
mtd: sharpslpart: Fix unsigned comparison to zero
authorYueHaibing <yuehaibing@huawei.com>
Mon, 30 Dec 2019 03:29:45 +0000 (11:29 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 13 Mar 2020 04:31:00 +0000 (00:31 -0400)
commit4fc9a9038a0c0100a81fcf1e5e265e9b0374b5dd
treebca36f58ee48dd9e9d2a136c6e12454345c25435
parent27e5d2edf64699e363cb7df84cc77412311b1c5b
mtd: sharpslpart: Fix unsigned comparison to zero

BugLink: https://bugs.launchpad.net/bugs/1867194
commit f33113b542219448fa02d77ca1c6f4265bd7f130 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/mtd/parsers/sharpslpart.c