Skip to content

Commit 61d6515

Browse files
axiqiavinodkoul
authored andcommitted
dmaengine: idxd: Add missing cleanups in cleanup internals
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: ddf742d ("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>
1 parent 61259fb commit 61d6515

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/dma/idxd/init.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -407,14 +407,9 @@ static int idxd_setup_groups(struct idxd_device *idxd)
407407

408408
static void idxd_cleanup_internals(struct idxd_device *idxd)
409409
{
410-
int i;
411-
412-
for (i = 0; i < idxd->max_groups; i++)
413-
put_device(group_confdev(idxd->groups[i]));
414-
for (i = 0; i < idxd->max_engines; i++)
415-
put_device(engine_confdev(idxd->engines[i]));
416-
for (i = 0; i < idxd->max_wqs; i++)
417-
put_device(wq_confdev(idxd->wqs[i]));
410+
idxd_clean_groups(idxd);
411+
idxd_clean_engines(idxd);
412+
idxd_clean_wqs(idxd);
418413
destroy_workqueue(idxd->wq);
419414
}
420415

0 commit comments

Comments
 (0)