summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/physmap-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/maps/physmap-core.c')
-rw-r--r--drivers/mtd/maps/physmap-core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/maps/physmap-core.c b/drivers/mtd/maps/physmap-core.c
index 001ed5deb622..4f63b8430c71 100644
--- a/drivers/mtd/maps/physmap-core.c
+++ b/drivers/mtd/maps/physmap-core.c
@@ -69,8 +69,10 @@ static int physmap_flash_remove(struct platform_device *dev)
int i, err = 0;
info = platform_get_drvdata(dev);
- if (!info)
+ if (!info) {
+ err = -EINVAL;
goto out;
+ }
if (info->cmtd) {
err = mtd_device_unregister(info->cmtd);