mtd/sst25l: check for null consistently
Subsystems (2)
PATCH 1/1 mtd/sst25l: check for null consistently
The rest of the function assumes that "data" can be null. I don't know the code well enough to say whether it can actually be null, but there is no harm in checking here.
Signed-off-by Dan Carpenter <[email protected]>
drivers/mtd/devices/sst25l.c +1 -1
@@ -454,7 +454,7 @@ static int __init sst25l_probe(struct spi_device *spi) parts, nr_parts); } - }else if (data->nr_parts) { + }else if (data && data->nr_parts) {dev_warn (&spi->dev,"ignoring %d default partitions on %s\n" , data->nr_parts, data->name); }
Artem Bityutskiy
AppliedQuoted 5 lines · Dan Carpenter
The rest of the function assumes that "data" can be null. I don't know the code well enough to say whether it can actually be null, but there is no harm in checking here.
Signed-off-by Dan Carpenter <[email protected]>
Pushed to l2-mtd-2.6.git, Thanks.
Signature · 2 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий)