mtd: maps: sa1100-flash: potential NULL dereference
We check for NULL but then dereference "info->mtd" on the next line.
Fixes: 72169755cf
('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>
This commit is contained in:
parent
161aaab8a0
commit
dc01a28d80
|
@ -230,8 +230,10 @@ static struct sa_info *sa1100_setup_mtd(struct platform_device *pdev,
|
||||||
|
|
||||||
info->mtd = mtd_concat_create(cdev, info->num_subdev,
|
info->mtd = mtd_concat_create(cdev, info->num_subdev,
|
||||||
plat->name);
|
plat->name);
|
||||||
if (info->mtd == NULL)
|
if (info->mtd == NULL) {
|
||||||
ret = -ENXIO;
|
ret = -ENXIO;
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
info->mtd->dev.parent = &pdev->dev;
|
info->mtd->dev.parent = &pdev->dev;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue