Skip to content

Commit 1f71b50

Browse files
ranj063keyonjie
authored andcommitted
drivers: intel: dmic: fix double free dmic_remove()
Disable dmic interrupts first followed freeing by the dmic task and finally, free the dmic pdata. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1 parent f47fe82 commit 1f71b50

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/drivers/intel/dmic.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,17 +1618,15 @@ static int dmic_remove(struct dai *dai)
16181618

16191619
dai_info(dai, "dmic_remove()");
16201620

1621-
/* remove scheduling */
1622-
schedule_task_free(&dmic->dmicwork);
1623-
1624-
rfree(dai_get_drvdata(dai));
1625-
dai_set_drvdata(dai, NULL);
1626-
16271621
interrupt_disable(dmic->irq, dai);
16281622
interrupt_unregister(dmic->irq, dai);
16291623

1624+
/* remove scheduling */
1625+
schedule_task_free(&dmic->dmicwork);
1626+
16301627
dai_info(dai, "dmic_remove(), dmic_active_fifos_mask = 0x%x, dmic_pause_mask = 0x%x",
16311628
active_fifos_mask, pause_mask);
1629+
dai_set_drvdata(dai, NULL);
16321630
rfree(dmic);
16331631

16341632
/* The next end tasks must be passed if another DAI FIFO still runs.

0 commit comments

Comments
 (0)