summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2014-05-20 13:13:48 +0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2014-05-27 16:08:29 +0400
commit151d6b21f973c585efa052b0ff0fab473ef47831 (patch)
tree9acb67c26d367d3136fa1d4b7423e555bc6b0292 /drivers/mtd
parentdac3698147655aba4d71a8e67d6dd46d7a86154f (diff)
downloadlinux-151d6b21f973c585efa052b0ff0fab473ef47831.tar.xz
UBI: block: Fix error path on alloc_workqueue failure
Otherwise we'd return a random value if allocation of the workqueue fails. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/block.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c
index 8d659e6a1b4c..389e5f0aee89 100644
--- a/drivers/mtd/ubi/block.c
+++ b/drivers/mtd/ubi/block.c
@@ -432,8 +432,10 @@ int ubiblock_create(struct ubi_volume_info *vi)
* Rembember workqueues are cheap, they're not threads.
*/
dev->wq = alloc_workqueue("%s", 0, 0, gd->disk_name);
- if (!dev->wq)
+ if (!dev->wq) {
+ ret = -ENOMEM;
goto out_free_queue;
+ }
INIT_WORK(&dev->work, ubiblock_do_work);
mutex_lock(&devices_mutex);