Commit dc01a28d authored by Dan Carpenter's avatar Dan Carpenter Committed by Brian Norris

mtd: maps: sa1100-flash: potential NULL dereference

We check for NULL but then dereference "info->mtd" on the next line.

Fixes: 72169755 ('mtd: maps: sa1100-flash: show parent device in sysfs')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent 161aaab8
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment