cxl/region: Fix memregion leaks in devm_cxl_add_region()
Move the mode verification to __create_region() before allocating the memregion to avoid the memregion leaks. Fixes: 6e099264 ("cxl/region: Add volatile region creation support") Signed-off-by: Li Zhijian <lizhijian@fujitsu.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Link: https://lore.kernel.org/r/20240507053421.456439-1-lizhijian@fujitsu.comSigned-off-by: Dave Jiang <dave.jiang@intel.com>
Showing
Please register or sign in to comment