mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 00:21:59 +00:00
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 <error27@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
parent
00b275dbfc
commit
a4b81ca509
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user