diff options
author | Axel Lin <axel.lin@ingics.com> | 2015-06-28 17:00:57 +0800 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2015-06-30 14:30:34 -0400 |
commit | daa1dee405d7d3d3e816b84a692e838a5647a02a (patch) | |
tree | 112850fd03fa7fedd7d71ee2f547d83dd444fd4b /drivers/nvdimm/bus.c | |
parent | af834d457d9ed69e14836b63d0da198fdd2ec706 (diff) | |
download | linux-daa1dee405d7d3d3e816b84a692e838a5647a02a.tar.bz2 |
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>
Diffstat (limited to 'drivers/nvdimm/bus.c')
-rw-r--r-- | drivers/nvdimm/bus.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index 73442bd824a7..7e2c43f701bc 100644 --- a/drivers/nvdimm/bus.c +++ b/drivers/nvdimm/bus.c @@ -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; |