aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>2014-05-05 06:11:52 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2014-07-28 11:52:06 -0400
commit495f2bf6c4ed2da5dcadac96312f71da2a5af949 (patch)
tree950867b4504638cbff5532491308a59f619a68c8 /drivers/mtd
parent545f7fdf6db866c26ac92346b35bc6489fb926d1 (diff)
UBI: block: Make ubiblock_resize return something
Currently, ubiblock_resize() can fail if the device is not found in the list. This commit changes the return type, so the function can return something meaningful on error paths. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/block.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c
index 8457df7ec5af..52cefae01887 100644
--- a/drivers/mtd/ubi/block.c
+++ b/drivers/mtd/ubi/block.c
@@ -498,7 +498,7 @@ int ubiblock_remove(struct ubi_volume_info *vi)
498 return 0; 498 return 0;
499} 499}
500 500
501static void ubiblock_resize(struct ubi_volume_info *vi) 501static int ubiblock_resize(struct ubi_volume_info *vi)
502{ 502{
503 struct ubiblock *dev; 503 struct ubiblock *dev;
504 int disk_capacity; 504 int disk_capacity;
@@ -512,7 +512,7 @@ static void ubiblock_resize(struct ubi_volume_info *vi)
512 dev = find_dev_nolock(vi->ubi_num, vi->vol_id); 512 dev = find_dev_nolock(vi->ubi_num, vi->vol_id);
513 if (!dev) { 513 if (!dev) {
514 mutex_unlock(&devices_mutex); 514 mutex_unlock(&devices_mutex);
515 return; 515 return -ENODEV;
516 } 516 }
517 517
518 mutex_lock(&dev->dev_mutex); 518 mutex_lock(&dev->dev_mutex);
@@ -521,6 +521,7 @@ static void ubiblock_resize(struct ubi_volume_info *vi)
521 ubi_msg("%s resized to %d LEBs", dev->gd->disk_name, vi->size); 521 ubi_msg("%s resized to %d LEBs", dev->gd->disk_name, vi->size);
522 mutex_unlock(&dev->dev_mutex); 522 mutex_unlock(&dev->dev_mutex);
523 mutex_unlock(&devices_mutex); 523 mutex_unlock(&devices_mutex);
524 return 0;
524} 525}
525 526
526static int ubiblock_notify(struct notifier_block *nb, 527static int ubiblock_notify(struct notifier_block *nb,