Skip to content

Commit dc01a28

Browse files
Dan Carpentercomputersforpeace
authored andcommitted
mtd: maps: sa1100-flash: potential NULL dereference
We check for NULL but then dereference "info->mtd" on the next line. Fixes: 7216975 ('mtd: maps: sa1100-flash: show parent device in sysfs') Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Brian Norris <[email protected]>
1 parent 161aaab commit dc01a28

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/mtd/maps/sa1100-flash.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,10 @@ static struct sa_info *sa1100_setup_mtd(struct platform_device *pdev,
230230

231231
info->mtd = mtd_concat_create(cdev, info->num_subdev,
232232
plat->name);
233-
if (info->mtd == NULL)
233+
if (info->mtd == NULL) {
234234
ret = -ENXIO;
235+
goto err;
236+
}
235237
}
236238
info->mtd->dev.parent = &pdev->dev;
237239

0 commit comments

Comments
 (0)