device-dax: Avoid an unnecessary check in alloc_dev_dax_range()
authorZhen Lei <thunder.leizhen@huawei.com>
Sat, 19 Dec 2020 08:18:40 +0000 (16:18 +0800)
committerDan Williams <dan.j.williams@intel.com>
Thu, 24 Dec 2020 18:06:57 +0000 (10:06 -0800)
commitff8da37d3d8d438ded5a4841d979899269b94d0d
tree2befe2f7e2644a83c0b8a8721e909e282f60efdd
parent6268d7da4d192af339f4d688942b9ccb45a65e04
device-dax: Avoid an unnecessary check in alloc_dev_dax_range()

Swap the calling sequence of krealloc() and __request_region(), call the
latter first. In this way, the value of dev_dax->nr_range does not need to
be considered when __request_region() failed.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Link: https://lore.kernel.org/r/20201219081840.1149-2-thunder.leizhen@huawei.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dax/bus.c