From 3d1dbf0e57a1ce159d8d3e6953902704dc1b09e6 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 30 Nov 2022 13:46:30 +0100 Subject: [PATCH] 6.0-stable patches added patches: asoc-intel-fix-unused-variable-warning-in-probe_codec.patch asoc-intel-skylake-fix-possible-memory-leak-in-skl_codec_device_init.patch asoc-sof-fix-compilation-when-hda_audio_codec-config-is-disabled.patch asoc-sof-intel-hda-codec-fix-possible-memory-leak-in-hda_codec_device_init.patch --- ...used-variable-warning-in-probe_codec.patch | 43 +++++++++++++++ ...memory-leak-in-skl_codec_device_init.patch | 52 ++++++++++++++++++ ...n-hda_audio_codec-config-is-disabled.patch | 33 ++++++++++++ ...memory-leak-in-hda_codec_device_init.patch | 53 +++++++++++++++++++ queue-6.0/series | 4 ++ 5 files changed, 185 insertions(+) create mode 100644 queue-6.0/asoc-intel-fix-unused-variable-warning-in-probe_codec.patch create mode 100644 queue-6.0/asoc-intel-skylake-fix-possible-memory-leak-in-skl_codec_device_init.patch create mode 100644 queue-6.0/asoc-sof-fix-compilation-when-hda_audio_codec-config-is-disabled.patch create mode 100644 queue-6.0/asoc-sof-intel-hda-codec-fix-possible-memory-leak-in-hda_codec_device_init.patch diff --git a/queue-6.0/asoc-intel-fix-unused-variable-warning-in-probe_codec.patch b/queue-6.0/asoc-intel-fix-unused-variable-warning-in-probe_codec.patch new file mode 100644 index 00000000000..1a50b5968d6 --- /dev/null +++ b/queue-6.0/asoc-intel-fix-unused-variable-warning-in-probe_codec.patch @@ -0,0 +1,43 @@ +From 515626a33a194c4caaf2879dbf9e00e882582af0 Mon Sep 17 00:00:00 2001 +From: Gaosheng Cui +Date: Mon, 22 Aug 2022 11:51:33 +0800 +Subject: ASoC: Intel: fix unused-variable warning in probe_codec +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Gaosheng Cui + +commit 515626a33a194c4caaf2879dbf9e00e882582af0 upstream. + +In configurations with CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=n, +gcc warns about an unused variable: + +sound/soc/intel/skylake/skl.c: In function ‘probe_codec’: +sound/soc/intel/skylake/skl.c:729:18: error: unused variable ‘skl’ [-Werror=unused-variable] + struct skl_dev *skl = bus_to_skl(bus); + ^~~ +cc1: all warnings being treated as errors + +Fixes: 3fd63658caed9 ("ASoC: Intel: Drop hdac_ext usage for codec device creation") +Signed-off-by: Gaosheng Cui +Acked-by: Cezary Rojewski +Link: https://lore.kernel.org/r/20220822035133.2147381-1-cuigaosheng1@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/intel/skylake/skl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/soc/intel/skylake/skl.c ++++ b/sound/soc/intel/skylake/skl.c +@@ -726,8 +726,8 @@ static int probe_codec(struct hdac_bus * + unsigned int cmd = (addr << 28) | (AC_NODE_ROOT << 20) | + (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID; + unsigned int res = -1; +- struct skl_dev *skl = bus_to_skl(bus); + #if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC) ++ struct skl_dev *skl = bus_to_skl(bus); + struct hdac_hda_priv *hda_codec; + #endif + struct hda_codec *codec; diff --git a/queue-6.0/asoc-intel-skylake-fix-possible-memory-leak-in-skl_codec_device_init.patch b/queue-6.0/asoc-intel-skylake-fix-possible-memory-leak-in-skl_codec_device_init.patch new file mode 100644 index 00000000000..a1e8a5ec6d7 --- /dev/null +++ b/queue-6.0/asoc-intel-skylake-fix-possible-memory-leak-in-skl_codec_device_init.patch @@ -0,0 +1,52 @@ +From 0e213813df02da048ffd22a2c4fac041768ca327 Mon Sep 17 00:00:00 2001 +From: Yang Yingliang +Date: Thu, 20 Oct 2022 18:59:37 +0800 +Subject: ASoC: Intel: Skylake: fix possible memory leak in skl_codec_device_init() + +From: Yang Yingliang + +commit 0e213813df02da048ffd22a2c4fac041768ca327 upstream. + +If snd_hdac_device_register() fails, 'codec' and name allocated in +dev_set_name() called in snd_hdac_device_init() are leaked. Fix this +by calling put_device(), so they can be freed in snd_hda_codec_dev_release() +and kobject_cleanup(). + +Fixes: e4746d94d00c ("ASoC: Intel: Skylake: Introduce HDA codec init and exit routines") +Signed-off-by: Yang Yingliang +Suggested-by: Cezary Rojewski +Link: https://lore.kernel.org/r/20221020105937.1448951-1-yangyingliang@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/intel/skylake/skl.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +--- a/sound/soc/intel/skylake/skl.c ++++ b/sound/soc/intel/skylake/skl.c +@@ -689,11 +689,6 @@ static void load_codec_module(struct hda + + #endif /* CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC */ + +-static void skl_codec_device_exit(struct device *dev) +-{ +- snd_hdac_device_exit(dev_to_hdac_dev(dev)); +-} +- + static struct hda_codec *skl_codec_device_init(struct hdac_bus *bus, int addr) + { + struct hda_codec *codec; +@@ -706,12 +701,11 @@ static struct hda_codec *skl_codec_devic + } + + codec->core.type = HDA_DEV_ASOC; +- codec->core.dev.release = skl_codec_device_exit; + + ret = snd_hdac_device_register(&codec->core); + if (ret) { + dev_err(bus->dev, "failed to register hdac device\n"); +- snd_hdac_device_exit(&codec->core); ++ put_device(&codec->core.dev); + return ERR_PTR(ret); + } + diff --git a/queue-6.0/asoc-sof-fix-compilation-when-hda_audio_codec-config-is-disabled.patch b/queue-6.0/asoc-sof-fix-compilation-when-hda_audio_codec-config-is-disabled.patch new file mode 100644 index 00000000000..5e654892761 --- /dev/null +++ b/queue-6.0/asoc-sof-fix-compilation-when-hda_audio_codec-config-is-disabled.patch @@ -0,0 +1,33 @@ +From 1cda83e42bf66beb06bf61c7a78951ec0c028898 Mon Sep 17 00:00:00 2001 +From: Cezary Rojewski +Date: Fri, 19 Aug 2022 14:47:40 +0200 +Subject: ASoC: SOF: Fix compilation when HDA_AUDIO_CODEC config is disabled + +From: Cezary Rojewski + +commit 1cda83e42bf66beb06bf61c7a78951ec0c028898 upstream. + +hda_codec_device_init() expects three parameters, not two. + +Fixes: 3fd63658caed ("ASoC: Intel: Drop hdac_ext usage for codec device creation") +Reported-by: kernel test robot +Signed-off-by: Cezary Rojewski +Acked-by: Mark Brown +Link: https://lore.kernel.org/r/20220819124740.3564862-1-cezary.rojewski@intel.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/sof/intel/hda-codec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/soc/sof/intel/hda-codec.c ++++ b/sound/soc/sof/intel/hda-codec.c +@@ -213,7 +213,7 @@ out: + put_device(&codec->core.dev); + } + #else +- codec = hda_codec_device_init(&hbus->core, address); ++ codec = hda_codec_device_init(&hbus->core, address, HDA_DEV_ASOC); + ret = PTR_ERR_OR_ZERO(codec); + #endif + diff --git a/queue-6.0/asoc-sof-intel-hda-codec-fix-possible-memory-leak-in-hda_codec_device_init.patch b/queue-6.0/asoc-sof-intel-hda-codec-fix-possible-memory-leak-in-hda_codec_device_init.patch new file mode 100644 index 00000000000..8acf4b5c910 --- /dev/null +++ b/queue-6.0/asoc-sof-intel-hda-codec-fix-possible-memory-leak-in-hda_codec_device_init.patch @@ -0,0 +1,53 @@ +From e9441675edc1bb8dbfadacf68aafacca60d65a25 Mon Sep 17 00:00:00 2001 +From: Yang Yingliang +Date: Thu, 20 Oct 2022 19:01:57 +0800 +Subject: ASoC: SOF: Intel: hda-codec: fix possible memory leak in hda_codec_device_init() + +From: Yang Yingliang + +commit e9441675edc1bb8dbfadacf68aafacca60d65a25 upstream. + +If snd_hdac_device_register() fails, 'codec' and name allocated in +dev_set_name() called in snd_hdac_device_init() are leaked. Fix this +by calling put_device(), so they can be freed in snd_hda_codec_dev_release() +and kobject_cleanup(). + +Fixes: 829c67319806 ("ASoC: SOF: Intel: Introduce HDA codec init and exit routines") +Fixes: dfe66a18780d ("ALSA: hdac_ext: add extended HDA bus") +Signed-off-by: Yang Yingliang +Reviewed-by: Kai Vehmanen +Link: https://lore.kernel.org/r/20221020110157.1450191-1-yangyingliang@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/sof/intel/hda-codec.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +--- a/sound/soc/sof/intel/hda-codec.c ++++ b/sound/soc/sof/intel/hda-codec.c +@@ -109,11 +109,6 @@ EXPORT_SYMBOL_NS(hda_codec_jack_check, S + #define is_generic_config(x) 0 + #endif + +-static void hda_codec_device_exit(struct device *dev) +-{ +- snd_hdac_device_exit(dev_to_hdac_dev(dev)); +-} +- + static struct hda_codec *hda_codec_device_init(struct hdac_bus *bus, int addr, int type) + { + struct hda_codec *codec; +@@ -126,12 +121,11 @@ static struct hda_codec *hda_codec_devic + } + + codec->core.type = type; +- codec->core.dev.release = hda_codec_device_exit; + + ret = snd_hdac_device_register(&codec->core); + if (ret) { + dev_err(bus->dev, "failed to register hdac device\n"); +- snd_hdac_device_exit(&codec->core); ++ put_device(&codec->core.dev); + return ERR_PTR(ret); + } + diff --git a/queue-6.0/series b/queue-6.0/series index 282fb134ceb..acca2e2417f 100644 --- a/queue-6.0/series +++ b/queue-6.0/series @@ -217,3 +217,7 @@ mm-fix-unexpected-changes-to-failslab-fail_page_alloc-.attr.patch mm-correctly-charge-compressed-memory-to-its-memcg.patch loongarch-clear-fpu-simd-thread-info-flags-for-kernel-thread.patch loongarch-set-_page_dirty-only-if-_page_write-is-set-in-pmd-pte-_mkdirty.patch +asoc-sof-fix-compilation-when-hda_audio_codec-config-is-disabled.patch +asoc-intel-fix-unused-variable-warning-in-probe_codec.patch +asoc-intel-skylake-fix-possible-memory-leak-in-skl_codec_device_init.patch +asoc-sof-intel-hda-codec-fix-possible-memory-leak-in-hda_codec_device_init.patch -- 2.47.3