nvdimm: Fix return value of nvdimm_bus_init() if class_create() fails

Return proper error if class_create() fails.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
Axel Lin 2015-06-28 17:00:57 +08:00 committed by Dan Williams
parent af834d457d
commit daa1dee405

View File

@ -699,8 +699,10 @@ int __init nvdimm_bus_init(void)
nvdimm_major = rc;
nd_class = class_create(THIS_MODULE, "nd");
if (IS_ERR(nd_class))
if (IS_ERR(nd_class)) {
rc = PTR_ERR(nd_class);
goto err_class;
}
return 0;