Skip to content

Commit

Permalink
mtd: sst25l: check for null consistently
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and David Woodhouse committed Aug 2, 2010
1 parent 00b275d commit a4b81ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/devices/sst25l.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit a4b81ca

Please sign in to comment.