From: Cezary Rojewski Date: Tue, 16 Aug 2022 11:17:25 +0000 (+0200) Subject: ALSA: hda: Always free codec on the device release X-Git-Tag: v6.6.17~6351^2~17^2~74 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0c5c29cafcea20f1f6a9943640e4a5a790e259ee;p=platform%2Fkernel%2Flinux-rpi.git ALSA: hda: Always free codec on the device release With all HDAudio drivers aligned to make use of the same constructor, have codec freed on the device release regardless of its type. Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220816111727.3218543-5-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 384426d..aa7a362 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -883,13 +883,7 @@ static void snd_hda_codec_dev_release(struct device *dev) snd_hda_sysfs_clear(codec); kfree(codec->modelname); kfree(codec->wcaps); - - /* - * In the case of ASoC HD-audio, hda_codec is device managed. - * It will be freed when the ASoC device is removed. - */ - if (codec->core.type == HDA_DEV_LEGACY) - kfree(codec); + kfree(codec); } #define DEV_NAME_LEN 31