]> git.karo-electronics.de Git - linux-beck.git/commitdiff
UBI: block: Fix error path on alloc_workqueue failure
authorHelmut Schaa <helmut.schaa@googlemail.com>
Tue, 20 May 2014 09:13:48 +0000 (11:13 +0200)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tue, 27 May 2014 12:08:29 +0000 (15:08 +0300)
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>
drivers/mtd/ubi/block.c

index 8d659e6a1b4c0899e32706b8bfa7fe3270ff715a..389e5f0aee89da9732e87b3d88824e54c921500b 100644 (file)
@@ -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);