diff options
author | Helmut Schaa <helmut.schaa@googlemail.com> | 2014-05-20 11:13:48 +0200 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2014-05-27 15:08:29 +0300 |
commit | 151d6b21f973c585efa052b0ff0fab473ef47831 (patch) | |
tree | 9acb67c26d367d3136fa1d4b7423e555bc6b0292 /drivers/mtd/ubi | |
parent | dac3698147655aba4d71a8e67d6dd46d7a86154f (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.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c index 8d659e6a1b4..389e5f0aee8 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); |