From: Helmut Schaa Date: Tue, 20 May 2014 09:13:48 +0000 (+0200) Subject: UBI: block: Fix error path on alloc_workqueue failure X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=151d6b21f973c585efa052b0ff0fab473ef47831;p=linux-beck.git 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 Acked-by: Brian Norris Signed-off-by: Artem Bityutskiy --- 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);