From: Axel Lin Date: Sun, 28 Jun 2015 09:00:57 +0000 (+0800) Subject: nvdimm: Fix return value of nvdimm_bus_init() if class_create() fails X-Git-Tag: v4.2-rc2~7^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=daa1dee405d7d3d3e816b84a692e838a5647a02a;p=profile%2Fcommon%2Fplatform%2Fkernel%2Flinux-artik7.git nvdimm: Fix return value of nvdimm_bus_init() if class_create() fails Return proper error if class_create() fails. Signed-off-by: Axel Lin Signed-off-by: Dan Williams --- diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index 73442bd..7e2c43f 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;