diff options
author | Ocean He <hehy1@lenovo.com> | 2018-08-03 14:08:33 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2018-12-11 00:41:34 +0100 |
commit | 9bf3aa44644721b287724ecac835d38f1dae4e2d (patch) | |
tree | 8944ab9cc8efa01a53e7aaf18dff1f3daacdf7ba /drivers/nvdimm | |
parent | Linux 4.20-rc6 (diff) | |
download | linux-9bf3aa44644721b287724ecac835d38f1dae4e2d.tar.xz linux-9bf3aa44644721b287724ecac835d38f1dae4e2d.zip |
libnvdimm, bus: Check id immediately following ida_simple_get
The id check was not executed immediately following ida_simple_get. Just
change the codes position, without function change.
Signed-off-by: Ocean He <hehy1@lenovo.com>
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r-- | drivers/nvdimm/bus.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index f1fb39921236..36da259ac9b5 100644 --- a/drivers/nvdimm/bus.c +++ b/drivers/nvdimm/bus.c @@ -344,12 +344,12 @@ struct nvdimm_bus *nvdimm_bus_register(struct device *parent, INIT_LIST_HEAD(&nvdimm_bus->mapping_list); init_waitqueue_head(&nvdimm_bus->probe_wait); nvdimm_bus->id = ida_simple_get(&nd_ida, 0, 0, GFP_KERNEL); - mutex_init(&nvdimm_bus->reconfig_mutex); - badrange_init(&nvdimm_bus->badrange); if (nvdimm_bus->id < 0) { kfree(nvdimm_bus); return NULL; } + mutex_init(&nvdimm_bus->reconfig_mutex); + badrange_init(&nvdimm_bus->badrange); nvdimm_bus->nd_desc = nd_desc; nvdimm_bus->dev.parent = parent; nvdimm_bus->dev.release = nvdimm_bus_release; |