Skip to content

Commit d68ccfd

Browse files
committed
Merge tag 'driver-core-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core fix from Greg KH: "Here is a single driver core fix for 5.17-rc6. It resolves a reported problem when the DMA map of a device is not properly released. It has been in linux-next with no reported problems" * tag 'driver-core-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: driver core: Free DMA range map when device is released
2 parents eae9350 + d8f7a54 commit d68ccfd

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/base/dd.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,9 @@ static int really_probe(struct device *dev, struct device_driver *drv)
629629
drv->remove(dev);
630630

631631
devres_release_all(dev);
632+
arch_teardown_dma_ops(dev);
633+
kfree(dev->dma_range_map);
634+
dev->dma_range_map = NULL;
632635
driver_sysfs_remove(dev);
633636
dev->driver = NULL;
634637
dev_set_drvdata(dev, NULL);
@@ -1209,6 +1212,8 @@ static void __device_release_driver(struct device *dev, struct device *parent)
12091212

12101213
devres_release_all(dev);
12111214
arch_teardown_dma_ops(dev);
1215+
kfree(dev->dma_range_map);
1216+
dev->dma_range_map = NULL;
12121217
dev->driver = NULL;
12131218
dev_set_drvdata(dev, NULL);
12141219
if (dev->pm_domain && dev->pm_domain->dismiss)

0 commit comments

Comments
 (0)