Skip to content

Commit 06f1d33

Browse files
axiqiagregkh
authored andcommitted
dmaengine: idxd: Add missing cleanups in cleanup internals
commit 61d6515 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: 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent aaaccce commit 06f1d33

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

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)