From: Jianyun Gao <[email protected]>

dax_core_init() mistakenly returns 0 on error paths. Change the
error return to use rc so the actual error code is propagated
to the caller.

Fixes: 9567da0b408a ("device-dax: Introduce bus + driver model")
Cc: [email protected]
Signed-off-by: Jianyun Gao <[email protected]>
---

Changes in v2:
- Drop unnecessary goto label, keep direct return for dax_fs_init() error
- Add Fixes tag and Cc stable

Link: 
https://lore.kernel.org/lkml/[email protected]/ # v1

 drivers/dax/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dax/super.c b/drivers/dax/super.c
index 45f84b0eb909..210f4af479f0 100644
--- a/drivers/dax/super.c
+++ b/drivers/dax/super.c
@@ -738,7 +738,7 @@ static int __init dax_core_init(void)
        unregister_chrdev_region(dax_devt, MINORMASK+1);
 err_chrdev:
        dax_fs_exit();
-       return 0;
+       return rc;
 }
 
 static void __exit dax_core_exit(void)
-- 
2.34.1


Reply via email to