From a4b81ca50974051195b11ca173da073b961f94d5 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sat, 22 May 2010 22:16:26 +0200 Subject: [PATCH] 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 Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- drivers/mtd/devices/sst25l.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/devices/sst25l.c b/drivers/mtd/devices/sst25l.c index ab5d8cd02a15..684247a8a5ed 100644 --- a/drivers/mtd/devices/sst25l.c +++ b/drivers/mtd/devices/sst25l.c @@ -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); } -- 2.39.5