]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
erofs: fix an error code in z_erofs_init_zip_subsystem()
authorDan Carpenter <error27@gmail.com>
Thu, 16 Feb 2023 12:13:04 +0000 (15:13 +0300)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Thu, 16 Feb 2023 14:51:53 +0000 (22:51 +0800)
Return -ENOMEM if alloc_workqueue() fails.  Don't return success.

Fixes: d8a650adf429 ("erofs: add per-cpu threads for decompression as an option")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/Y+4d0FRsUq8jPoOu@kili
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
fs/erofs/zdata.c

index 8ea3f5fe985e4c75c407d573df3face958ed28a2..3247d2422beae75d71d95345287d78135e5bc50f 100644 (file)
@@ -475,8 +475,10 @@ int __init z_erofs_init_zip_subsystem(void)
 
        z_erofs_workqueue = alloc_workqueue("erofs_worker",
                        WQ_UNBOUND | WQ_HIGHPRI, num_possible_cpus());
-       if (!z_erofs_workqueue)
+       if (!z_erofs_workqueue) {
+               err = -ENOMEM;
                goto out_error_workqueue_init;
+       }
 
        err = erofs_init_percpu_workers();
        if (err)