Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 151d6b21 authored by Helmut Schaa's avatar Helmut Schaa Committed by Artem Bityutskiy
Browse files

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: default avatarHelmut Schaa <helmut.schaa@googlemail.com>
Acked-by: default avatarBrian Norris <computersforpeace@gmail.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
parent dac36981
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);