aboutsummaryrefslogtreecommitdiff
path: root/include/sound/hdaudio.h
diff options
context:
space:
mode:
authorGravatar Cezary Rojewski <cezary.rojewski@intel.com> 2022-07-06 14:02:26 +0200
committerGravatar Takashi Iwai <tiwai@suse.de> 2022-07-15 16:26:50 +0200
commite7255c00b10e5e570dd8eb24f59e964eeec38d3b (patch)
tree683616d9489b7085e3454a3233ef116eb486411d /include/sound/hdaudio.h
parentALSA: hda: cs35l41: Add module parameter to control firmware load (diff)
downloadlinux-e7255c00b10e5e570dd8eb24f59e964eeec38d3b.tar.gz
linux-e7255c00b10e5e570dd8eb24f59e964eeec38d3b.tar.bz2
linux-e7255c00b10e5e570dd8eb24f59e964eeec38d3b.zip
ALSA: hda: Skip event processing for unregistered codecs
When codec is unbound but not yet removed, in the eyes of snd_hdac_bus_process_unsol_events() it is still a valid target to delegate work to. Such behaviour may lead to use-after-free errors. Address by verifying if codec is actually registered. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220706120230.427296-6-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound/hdaudio.h')
-rw-r--r--include/sound/hdaudio.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h
index 15f15075238d..797bf67a164d 100644
--- a/include/sound/hdaudio.h
+++ b/include/sound/hdaudio.h
@@ -93,6 +93,7 @@ struct hdac_device {
bool lazy_cache:1; /* don't wake up for writes */
bool caps_overwriting:1; /* caps overwrite being in process */
bool cache_coef:1; /* cache COEF read/write too */
+ unsigned int registered:1; /* codec was registered */
};
/* device/driver type used for matching */