]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
mtd: spi-nor: Potential oops on error path in quad_enable()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 5 May 2017 05:33:56 +0000 (08:33 +0300)
committerCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
Mon, 15 May 2017 19:56:18 +0000 (21:56 +0200)
commit05d090f00203bdcf722b9cb6d5ac57c165e2c95c
tree5afead15bd3a733bdd527419d2d60d47c581098f
parentddd0503e4d780607865950e14f215bf8660ed683
mtd: spi-nor: Potential oops on error path in quad_enable()

Before commit cff959958832 ("mtd: spi-nor: introduce SPI 1-2-2 and SPI
1-4-4 protocols") then we treated 1 as -EINVAL in the caller but after
that commit we changed to propagate the return.  My static checker
complains that it's eventually passed to an ERR_PTR() and later
dereferenced, but I'm not totally certain if that's true.  Regardless,
returning 1 is wrong.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
drivers/mtd/spi-nor/spi-nor.c