diff options
| author | Shuai Xue <xueshuai@linux.alibaba.com> | 2025-04-04 20:02:13 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-05-22 14:10:07 +0200 |
| commit | 24d9c14fdc63b6df552d5bbe71f9fc113690a1e5 (patch) | |
| tree | 30c08dfcc80cc799bca9c47b294e0e2e5691d24f /drivers/dma | |
| parent | 9b4947544bbd0968c8eef1d8de7a9e752e87505d (diff) | |
| download | linux-24d9c14fdc63b6df552d5bbe71f9fc113690a1e5.tar.gz linux-24d9c14fdc63b6df552d5bbe71f9fc113690a1e5.tar.bz2 linux-24d9c14fdc63b6df552d5bbe71f9fc113690a1e5.zip | |
dmaengine: idxd: Add missing cleanups in cleanup internals
commit 61d651572b6c4fe50c7b39a390760f3a910c7ccf upstream.
The idxd_cleanup_internals() function only decreases the reference count
of groups, engines, and wqs but is missing the step to release memory
resources.
To fix this, use the cleanup helper to properly release the memory
resources.
Fixes: ddf742d4f3f1 ("dmaengine: idxd: Add missing cleanup for early error out in probe call")
Cc: stable@vger.kernel.org
Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com>
Reviewed-by: Fenghua Yu <fenghuay@nvidia.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20250404120217.48772-6-xueshuai@linux.alibaba.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/dma')
| -rw-r--r-- | drivers/dma/idxd/init.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c index 3e89891781e3..6b5c1e803793 100644 --- a/drivers/dma/idxd/init.c +++ b/drivers/dma/idxd/init.c @@ -386,14 +386,9 @@ static int idxd_setup_groups(struct idxd_device *idxd) static void idxd_cleanup_internals(struct idxd_device *idxd) { - int i; - - for (i = 0; i < idxd->max_groups; i++) - put_device(group_confdev(idxd->groups[i])); - for (i = 0; i < idxd->max_engines; i++) - put_device(engine_confdev(idxd->engines[i])); - for (i = 0; i < idxd->max_wqs; i++) - put_device(wq_confdev(idxd->wqs[i])); + idxd_clean_groups(idxd); + idxd_clean_engines(idxd); + idxd_clean_wqs(idxd); destroy_workqueue(idxd->wq); } |
