diff options
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/maps/physmap_of.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c index cde8bf94338e..37cdc201652f 100644 --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c | |||
@@ -285,6 +285,7 @@ static int of_flash_probe(struct platform_device *dev) | |||
285 | } | 285 | } |
286 | 286 | ||
287 | err = 0; | 287 | err = 0; |
288 | info->cmtd = NULL; | ||
288 | if (info->list_size == 1) { | 289 | if (info->list_size == 1) { |
289 | info->cmtd = info->list[0].mtd; | 290 | info->cmtd = info->list[0].mtd; |
290 | } else if (info->list_size > 1) { | 291 | } else if (info->list_size > 1) { |
@@ -293,9 +294,10 @@ static int of_flash_probe(struct platform_device *dev) | |||
293 | */ | 294 | */ |
294 | info->cmtd = mtd_concat_create(mtd_list, info->list_size, | 295 | info->cmtd = mtd_concat_create(mtd_list, info->list_size, |
295 | dev_name(&dev->dev)); | 296 | dev_name(&dev->dev)); |
296 | if (info->cmtd == NULL) | ||
297 | err = -ENXIO; | ||
298 | } | 297 | } |
298 | if (info->cmtd == NULL) | ||
299 | err = -ENXIO; | ||
300 | |||
299 | if (err) | 301 | if (err) |
300 | goto err_out; | 302 | goto err_out; |
301 | 303 | ||