1
0
Fork 0

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>
hifive-unleashed-5.1
Axel Lin 2015-06-28 17:00:57 +08:00 committed by Dan Williams
parent af834d457d
commit daa1dee405
1 changed files with 3 additions and 1 deletions

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;