]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit93fd1d5e9b4ed51d2a938926416e999a5c43306b
tree2befe2f7e2644a83c0b8a8721e909e282f60efdd
parent6f415046b24466aba9d41658df0e2b1ab498b114
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