Skip to contentSkip to conversation

mtd/sst25l: check for null consistently

PATCH Applied Dan Carpenter 2 participants 2 messages May 22, 2010 – Jun 12, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

drivers/mtd/devices/sst25l.c +1 -1
index ab5d8cd..684247a 100644
@@ -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);
 	}
#1 lore raw
Quoted 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.

Pushed to l2-mtd-2.6.git, Thanks.

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)