OSDN Git Service

mtd: rawnand: s3c2410: Error out when ->nrsets < 0 or ->sets == NULL
authorBoris Brezillon <boris.brezillon@bootlin.com>
Thu, 19 Jul 2018 20:53:50 +0000 (22:53 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 31 Jul 2018 07:45:51 +0000 (09:45 +0200)
commitbdc4e58d5395fb45e22a54e01312f1abb22523ef
treeec023835f1b4ce202ac8f43f81ab62c9253bc360
parent760c435e0f85ed19e48a90d746ce1de2cd02def7
mtd: rawnand: s3c2410: Error out when ->nrsets < 0 or ->sets == NULL

All of the code in the probe path assumes ->sets != NULL and
->nrsets > 0. Error out if that's not the case to avoid dereferencing a
NULL pointer.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/s3c2410.c