Skip to content

Commit

Permalink
mtd: maps: sa1100-flash: potential NULL dereference
Browse files Browse the repository at this point in the history
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 <dan.carpenter@oracle.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
  • Loading branch information
Dan Carpenter authored and Brian Norris committed Jul 16, 2016
1 parent 161aaab commit dc01a28
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/mtd/maps/sa1100-flash.c
Original file line number Diff line number Diff line change
@@ -230,8 +230,10 @@ static struct sa_info *sa1100_setup_mtd(struct platform_device *pdev,

info->mtd = mtd_concat_create(cdev, info->num_subdev,
plat->name);
if (info->mtd == NULL)
if (info->mtd == NULL) {
ret = -ENXIO;
goto err;
}
}
info->mtd->dev.parent = &pdev->dev;

0 comments on commit dc01a28

Please sign in to comment.