mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
dax: Return errors from dax_core_init()
dax_core_init() returns success when either the character device
number allocation or DAX bus registration fails, even though the
error paths have already released the initialized resources.
For modular DAX, this allows the module to remain loaded despite
failed initialization, leaving subsequent users and module removal
to access resources that have already been released.
Return the error code from the failed operation so that module
loading fails rather than reporting successful initialization
after the resources have been released.
Fixes: 9567da0b40 ("device-dax: Introduce bus + driver model")
Cc: stable@vger.kernel.org
Signed-off-by: Jianyun Gao <jianyungao89@gmail.com>
Reviewed-by: Gregory Price (Meta) <gourry@gourry.net>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20261012151857.22534-1-jianyungao89@gmail.com
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
This commit is contained in:
parent
c0962f508e
commit
4da700e2ca
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user