aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2014-05-20 05:13:48 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2014-05-27 08:08:29 -0400
commit151d6b21f973c585efa052b0ff0fab473ef47831 (patch)
tree9acb67c26d367d3136fa1d4b7423e555bc6b0292 /drivers/mtd/ubi
parentdac3698147655aba4d71a8e67d6dd46d7a86154f (diff)
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/ubi')
-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)
432 * Rembember workqueues are cheap, they're not threads. 432 * Rembember workqueues are cheap, they're not threads.
433 */ 433 */
434 dev->wq = alloc_workqueue("%s", 0, 0, gd->disk_name); 434 dev->wq = alloc_workqueue("%s", 0, 0, gd->disk_name);
435 if (!dev->wq) 435 if (!dev->wq) {
436 ret = -ENOMEM;
436 goto out_free_queue; 437 goto out_free_queue;
438 }
437 INIT_WORK(&dev->work, ubiblock_do_work); 439 INIT_WORK(&dev->work, ubiblock_do_work);
438 440
439 mutex_lock(&devices_mutex); 441 mutex_lock(&devices_mutex);