Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 804cbf4b authored by Keyon Jie's avatar Keyon Jie Committed by Mark Brown
Browse files

ASoC: hdac_hda: fix page fault issue by removing race

There is a race between hda codec device removing and the
jack-detecting work, which will lead to a page fault issue as the
latter work is accessing codec device which could be already removed.

Here add the cancellation of jack-detecting work before codecs are actually
removed to avoid the race and fix the issue.

Bug: https://github.com/thesofproject/linux/issues/1067


Signed-off-by: default avatarKeyon Jie <yang.jie@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190807145030.26117-1-pierre-louis.bossart@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent cc352735
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -495,6 +495,10 @@ static int hdac_hda_dev_probe(struct hdac_device *hdev)


static int hdac_hda_dev_remove(struct hdac_device *hdev)
static int hdac_hda_dev_remove(struct hdac_device *hdev)
{
{
	struct hdac_hda_priv *hda_pvt;

	hda_pvt = dev_get_drvdata(&hdev->dev);
	cancel_delayed_work_sync(&hda_pvt->codec.jackpoll_work);
	return 0;
	return 0;
}
}