Skip to content

Commit 24d9c14

Browse files
axiqiagregkh
authored andcommitted
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: 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 9b49475 commit 24d9c14

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

387387
static void idxd_cleanup_internals(struct idxd_device *idxd)
388388
{
389-
int i;
390-
391-
for (i = 0; i < idxd->max_groups; i++)
392-
put_device(group_confdev(idxd->groups[i]));
393-
for (i = 0; i < idxd->max_engines; i++)
394-
put_device(engine_confdev(idxd->engines[i]));
395-
for (i = 0; i < idxd->max_wqs; i++)
396-
put_device(wq_confdev(idxd->wqs[i]));
389+
idxd_clean_groups(idxd);
390+
idxd_clean_engines(idxd);
391+
idxd_clean_wqs(idxd);
397392
destroy_workqueue(idxd->wq);
398393
}
399394

0 commit comments

Comments
 (0)