Message ID | 20230602-dax-region-put-v1-2-d8668f335d45@intel.com |
---|---|
State | New, archived |
Headers | show |
Series | dax: Clean up dax_region references | expand |
diff --git a/drivers/dax/hmem/hmem.c b/drivers/dax/hmem/hmem.c index e5fe8b39fb94..b4831a3d3934 100644 --- a/drivers/dax/hmem/hmem.c +++ b/drivers/dax/hmem/hmem.c @@ -39,12 +39,10 @@ static int dax_hmem_probe(struct platform_device *pdev) .size = region_idle ? 0 : range_len(&mri->range), }; dev_dax = devm_create_dev_dax(&data); - if (IS_ERR(dev_dax)) - return PTR_ERR(dev_dax); /* child dev_dax instances now own the lifetime of the dax_region */ dax_region_put(dax_region); - return 0; + return IS_ERR(dev_dax) ? PTR_ERR(dev_dax) : 0; } static struct platform_driver dax_hmem_driver = {