mtd: spi-nor-core: Fix static checker warnings
authorVignesh Raghavendra <vigneshr@ti.com>
Sat, 9 Nov 2019 06:34:13 +0000 (12:04 +0530)
committerJagan Teki <jagan@amarulasolutions.com>
Fri, 27 Dec 2019 12:17:26 +0000 (17:47 +0530)
commitcb56caacf8113cef90a3b477f08912260fd6a02e
tree6bd75d3876e7732bee51c8cc8bef784a638d54e5
parent864d66431a05a1ab78ac2995c1e98bd460766b35
mtd: spi-nor-core: Fix static checker warnings

Static checker warns 'ret' variable may be used uninitialized in
spi_nor_erase() and spi_nor_write() in case of zero length requests.
Fix these warnings by checking for zero length requests and returning
early.

Reported-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
drivers/mtd/spi/spi-nor-core.c