Skip to content

Commit e0ba67b

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: [email protected] Signed-off-by: Shuai Xue <[email protected]> Reviewed-by: Fenghua Yu <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 80b0260 commit e0ba67b

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
@@ -405,14 +405,9 @@ static int idxd_setup_groups(struct idxd_device *idxd)
405405

406406
static void idxd_cleanup_internals(struct idxd_device *idxd)
407407
{
408-
int i;
409-
410-
for (i = 0; i < idxd->max_groups; i++)
411-
put_device(group_confdev(idxd->groups[i]));
412-
for (i = 0; i < idxd->max_engines; i++)
413-
put_device(engine_confdev(idxd->engines[i]));
414-
for (i = 0; i < idxd->max_wqs; i++)
415-
put_device(wq_confdev(idxd->wqs[i]));
408+
idxd_clean_groups(idxd);
409+
idxd_clean_engines(idxd);
410+
idxd_clean_wqs(idxd);
416411
destroy_workqueue(idxd->wq);
417412
}
418413

0 commit comments

Comments
 (0)