提交 151d6b21 编写于 作者: H Helmut Schaa 提交者: Artem Bityutskiy

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: NHelmut Schaa <helmut.schaa@googlemail.com>
Acked-by: NBrian Norris <computersforpeace@gmail.com>
Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
上级 dac36981
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册