diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-02-25 12:05:40 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-02-25 12:05:40 -0800 |
commit | d68ccfdbe5205c746c6ad145c771a4db19fb8dc0 (patch) | |
tree | 9c4fe94d13cbb1d6c2f3c66527ba42936eca0040 /drivers/base | |
parent | eae9350eb40aa0b07c280ab3a504bdc65c2211f1 (diff) | |
parent | d8f7a5484f2188e9af2d9e4e587587d724501b12 (diff) |
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
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/dd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 9eaaff2f556c..f47cab21430f 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -629,6 +629,9 @@ re_probe: drv->remove(dev); devres_release_all(dev); + arch_teardown_dma_ops(dev); + kfree(dev->dma_range_map); + dev->dma_range_map = NULL; driver_sysfs_remove(dev); dev->driver = NULL; dev_set_drvdata(dev, NULL); @@ -1209,6 +1212,8 @@ static void __device_release_driver(struct device *dev, struct device *parent) devres_release_all(dev); arch_teardown_dma_ops(dev); + kfree(dev->dma_range_map); + dev->dma_range_map = NULL; dev->driver = NULL; dev_set_drvdata(dev, NULL); if (dev->pm_domain && dev->pm_domain->dismiss) |