提交 495f2bf6 编写于 作者: E Ezequiel Garcia 提交者: Artem Bityutskiy

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: Nkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: NEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
上级 545f7fdf
...@@ -498,7 +498,7 @@ int ubiblock_remove(struct ubi_volume_info *vi) ...@@ -498,7 +498,7 @@ int ubiblock_remove(struct ubi_volume_info *vi)
return 0; return 0;
} }
static void ubiblock_resize(struct ubi_volume_info *vi) static int ubiblock_resize(struct ubi_volume_info *vi)
{ {
struct ubiblock *dev; struct ubiblock *dev;
int disk_capacity; int disk_capacity;
...@@ -512,7 +512,7 @@ static void ubiblock_resize(struct ubi_volume_info *vi) ...@@ -512,7 +512,7 @@ static void ubiblock_resize(struct ubi_volume_info *vi)
dev = find_dev_nolock(vi->ubi_num, vi->vol_id); dev = find_dev_nolock(vi->ubi_num, vi->vol_id);
if (!dev) { if (!dev) {
mutex_unlock(&devices_mutex); mutex_unlock(&devices_mutex);
return; return -ENODEV;
} }
mutex_lock(&dev->dev_mutex); mutex_lock(&dev->dev_mutex);
...@@ -521,6 +521,7 @@ static void ubiblock_resize(struct ubi_volume_info *vi) ...@@ -521,6 +521,7 @@ static void ubiblock_resize(struct ubi_volume_info *vi)
ubi_msg("%s resized to %d LEBs", dev->gd->disk_name, vi->size); ubi_msg("%s resized to %d LEBs", dev->gd->disk_name, vi->size);
mutex_unlock(&dev->dev_mutex); mutex_unlock(&dev->dev_mutex);
mutex_unlock(&devices_mutex); mutex_unlock(&devices_mutex);
return 0;
} }
static int ubiblock_notify(struct notifier_block *nb, static int ubiblock_notify(struct notifier_block *nb,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册