Skip to contentSkip to conversation

mtd/sst25l: check for null consistently

PATCH In review [email protected] 3 participants 4 messages Jul 20, 2010 – Jul 21, 2010 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 mtd/sst25l: check for null consistently

From: Dan Carpenter <[email protected]>

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.

Cc Artem Bityutskiy <[email protected]>
Cc Andre Renaud <[email protected]>
Cc David Woodhouse <[email protected]>

---

 drivers/mtd/devices/sst25l.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/devices/sst25l.c renamed from drivers/mtd/devices/sst25l.c~mtd-sst25l-check-for-null-consistently +1 -1
diff -puN drivers/mtd/devices/sst25l.c~mtd-sst25l-check-for-null-consistently drivers/mtd/devices/sst25l.c
@@ -454,7 +454,7 @@ static int __init sst25l_probe(struct sp
 						  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 11 lines · On Tue, 2010-07-20 at 15:23 -0700, [email protected] wrote:

From: Dan Carpenter <[email protected]>

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.

Cc Artem Bityutskiy <[email protected]>
Cc Andre Renaud <[email protected]>
Cc David Woodhouse <[email protected]>

This patch is also in my l2-mtd-2.6 / master tree.

The tree: http://git.infradead.org/users/dedekind/l2-mtd-2.6.git

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
#2 lore raw
Quoted 13 lines · On Wed, 21 Jul 2010 13:34:12 +0300 Artem Bityutskiy…
Quoted 11 lines · On Tue, 2010-07-20 at 15:23 -0700, [email protected] wrote:

From: Dan Carpenter <[email protected]>

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.

Cc Artem Bityutskiy <[email protected]>
Cc Andre Renaud <[email protected]>
Cc David Woodhouse <[email protected]>
Quoted 3 lines

This patch is also in my l2-mtd-2.6 / master tree.

The tree: http://git.infradead.org/users/dedekind/l2-mtd-2.6.git

Can we add that tree to linux-next?

#3 lore raw
Quoted 15 lines · Andrew Morton
Quoted 13 lines · On Wed, 21 Jul 2010 13:34:12 +0300 Artem Bityutskiy…
Quoted 11 lines · On Tue, 2010-07-20 at 15:23 -0700, [email protected] wrote:

From: Dan Carpenter <[email protected]>

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.

Cc Artem Bityutskiy <[email protected]>
Cc Andre Renaud <[email protected]>
Cc David Woodhouse <[email protected]>
Quoted 5 lines
Quoted 3 lines

This patch is also in my l2-mtd-2.6 / master tree.

The tree: http://git.infradead.org/users/dedekind/l2-mtd-2.6.git

Can we add that tree to linux-next?

Well... This is not the first time you are requesting this :) Up to dwmw2, but alternatively, he could just look at my tree more often.

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