aboutsummaryrefslogtreecommitdiff
path: root/drivers/dax/bus.c
diff options
context:
space:
mode:
authorGravatar Dan Williams <dan.j.williams@intel.com> 2023-06-02 23:13:59 -0700
committerGravatar Vishal Verma <vishal.l.verma@intel.com> 2023-06-23 01:03:50 -0600
commit82b4ceeccb89cfd0b03706f1b15e31a7db6a027d (patch)
tree4daae04adddf2f5956b5cd192cd6f1cb70fd59fd /drivers/dax/bus.c
parentdax: Fix dax_mapping_release() use after free (diff)
downloadlinux-82b4ceeccb89cfd0b03706f1b15e31a7db6a027d.tar.gz
linux-82b4ceeccb89cfd0b03706f1b15e31a7db6a027d.tar.bz2
linux-82b4ceeccb89cfd0b03706f1b15e31a7db6a027d.zip
dax: Use device_unregister() in unregister_dax_mapping()
Replace an open-coded device_unregister() sequence with the helper. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Link: https://lore.kernel.org/r/168577283989.1672036.7777592498865470652.stgit@dwillia2-xfh.jf.intel.com Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Fan Ni <fan.ni@samsung.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Diffstat (limited to 'drivers/dax/bus.c')
-rw-r--r--drivers/dax/bus.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
index aee695f86b44..c99ea08aafc3 100644
--- a/drivers/dax/bus.c
+++ b/drivers/dax/bus.c
@@ -657,8 +657,7 @@ static void unregister_dax_mapping(void *data)
dev_dax->ranges[mapping->range_id].mapping = NULL;
mapping->range_id = -1;
- device_del(dev);
- put_device(dev);
+ device_unregister(dev);
}
static struct dev_dax_range *get_dax_range(struct device *dev)