android_kernel_xiaomi_sm8450/sound/soc
Kuninori Morimoto 0f312dc1eb ASoC: simple-card: fixup asoc_simple_probe() error handling
commit 41bae58df411f9accf01ea660730649b2fab1dab upstream.

asoc_simple_probe() is used for both "DT probe" (A) and "platform probe"
(B). It uses "goto err" when error case, but it is not needed for
"platform probe" case (B). Thus it is using "return" directly there.

	static int asoc_simple_probe(...)
	{
 ^		if (...) {
 |			...
(A)			if (ret < 0)
 |				goto err;
 v		} else {
 ^			...
 |			if (ret < 0)
(B)				return -Exxx;
 v		}

		...
 ^		if (ret < 0)
(C)			goto err;
 v		...

	err:
(D)		simple_util_clean_reference(card);

		return ret;
	}

Both case are using (C) part, and it calls (D) when err case.
But (D) will do nothing for (B) case.
Because of these behavior, current code itself is not wrong,
but is confusable, and more, static analyzing tool will warning on
(B) part (should use goto err).

To avoid static analyzing tool warning, this patch uses "goto err"
on (B) part.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o7hy7mlh.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-08 08:46:10 +01:00
..
adi
amd ASoC: amd: Fix reference to PCM buffer address 2021-08-18 08:59:05 +02:00
atmel ASoC: atmel: Fix the 8K sample parameter in I2SC master 2023-09-19 12:20:05 +02:00
au1x ASoC: au1x: use asoc_substream_to_rtd() 2020-07-23 19:07:36 +01:00
bcm ASoC: bcm2835: Silence clk_get() error on -EPROBE_DEFER 2020-07-28 17:04:07 +01:00
cirrus ASoC: cirrus: use asoc_substream_to_rtd() 2020-07-23 19:07:28 +01:00
codecs ASoC: rt5650: fix the wrong result of key button 2023-11-08 17:30:49 +01:00
dwc ASoC: dwc: move DMA init to snd_soc_dai_driver probe() 2023-06-21 15:45:36 +02:00
fsl ASoC: fsl: Fix PM disable depth imbalance in fsl_easrc_probe 2023-11-20 11:06:51 +01:00
generic ASoC: simple-card: fixup asoc_simple_probe() error handling 2023-12-08 08:46:10 +01:00
hisilicon ASoC: hisilicon: fix missing clk_disable_unprepare() on error in hi6210_i2s_startup() 2021-07-14 16:56:37 +02:00
img ASoC: img: Fix PM reference leak in img_i2s_in_probe() 2021-07-20 16:05:42 +02:00
intel ASoC: Intel: Skylake: Fix mem leak when parsing UUIDs fails 2023-11-20 11:06:52 +01:00
jz4740 ASoC: jz4740-i2s: Handle independent FIFO flush bits 2023-01-14 10:16:35 +01:00
kirkwood ASoC: kirkwood: Iterate over array indexes instead of using pointer math 2023-03-11 16:39:53 +01:00
mediatek ASoC: mediatek: mt8173: Fix snd_soc_component_initialize error path 2023-07-27 08:44:14 +02:00
meson ASoC: meson: spdifin: start hw on dai probe 2023-10-10 21:53:26 +02:00
mxs ASoC: mxs-saif: Fix refcount leak in mxs_saif_probe 2022-06-09 10:21:07 +02:00
pxa ASoC: pxa: fix a memory leak in probe() 2023-10-25 11:54:25 +02:00
qcom ASoC: qcom: lpass-cpu: Fix fallback SD line index handling 2023-01-18 11:44:54 +01:00
rockchip ASoC: rockchip: spdif: Add missing clk_disable_unprepare() in rk_spdif_runtime_resume() 2023-01-14 10:16:21 +01:00
samsung ASoC: samsung: change gpiod_speaker_power and rx1950_audio from global to static variables 2022-08-21 15:16:06 +02:00
sh ASoC: rsnd: Add check for rsnd_mod_power_on 2022-10-26 13:25:26 +02:00
sirf
sof ASoC: SOF: Intel: hda-dai: fix possible stream_tag leak 2023-02-22 12:56:00 +01:00
spear ASoC: spear: merge .digital_mute() into .mute_stream() 2020-07-16 23:06:08 +01:00
sprd ASoC: various vendors: delete repeated words in comments 2020-08-18 14:52:32 +01:00
sti ASoC: sti: Fix deadlock via snd_pcm_stop_xrun() call 2022-03-28 09:57:08 +02:00
stm ASoC: stm32: dfsdm: change rate limits 2020-10-08 20:44:40 +01:00
sunxi ASoC: sunxi: sun4i-codec: fill ASoC card owner 2021-04-14 08:42:08 +02:00
tegra ASoC: tegra: Fix kcontrol put callback in AHUB 2021-12-08 09:03:25 +01:00
ti ASoC: ti: omap-mcbsp: Fix runtime PM underflow warnings 2023-11-28 16:54:53 +00:00
txx9 ASoC: txx9: Replace tasklet with work 2020-09-09 15:42:10 +01:00
uniphier ASoC: uniphier: drop selecting non-existing SND_SOC_UNIPHIER_AIO_DMA 2022-01-27 10:54:05 +01:00
ux500 ASoC: ux500: use asoc_substream_to_rtd() 2020-07-23 19:07:20 +01:00
xilinx ASoC: xilinx: xlnx_formatter_pcm: Handle sysclk setting 2022-04-08 14:40:05 +02:00
xtensa ASoC: xtensa: use asoc_substream_to_rtd() 2020-07-23 19:07:42 +01:00
zte treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile ASoC: soc-component: merge soc-io.c into soc-component.c 2020-06-15 18:21:26 +01:00
soc-ac97.c ASoC: soc-ac97: fix kernel-doc 2020-07-03 17:33:46 +01:00
soc-acpi.c
soc-card.c ASoC: soc-card: add snd_soc_card_remove_dai_link() 2020-05-30 02:11:42 +01:00
soc-component.c ASoC: component: Remove misplaced prefix handling in pin control functions 2021-09-03 10:09:21 +02:00
soc-compress.c ASoC: soc-compress.c: fixup private_data on snd_soc_new_compress() 2023-03-11 16:39:35 +01:00
soc-core.c ASoC: core: Fix use-after-free in snd_soc_exit() 2022-11-25 17:45:42 +01:00
soc-dai.c ASoC: soc-dai: add mark for snd_soc_dai_startup/shutdown() 2020-09-28 17:01:42 +01:00
soc-dapm.c ASoC: dapm: Initialise kcontrol data for mux/demux controls 2022-07-21 21:20:16 +02:00
soc-devres.c ASoC: core: Remove only the registered component in devm functions 2020-07-07 11:55:46 +01:00
soc-generic-dmaengine-pcm.c ASoC: dmaengine: Restore NULL prepare_slave_config() callback 2022-05-12 12:25:37 +02:00
soc-jack.c ASoC: soc-card: move snd_soc_card_jack_new() to soc-card 2020-05-30 02:11:28 +01:00
soc-link.c ASoC: soc-link: add mark for snd_soc_link_startup/shutdown() 2020-09-28 17:01:43 +01:00
soc-ops.c ASoC: ops: Correct bounds check for second channel on SX controls 2022-12-19 12:27:32 +01:00
soc-pcm.c ASoC: soc-pcm: test if a BE can be prepared 2023-06-21 15:45:36 +02:00
soc-topology.c ASoC: topology: Allow TLV control to be either read or write 2022-04-08 14:40:44 +02:00
soc-utils.c ASoC: soc-utils: Remove __exit for snd_soc_util_exit() 2022-11-25 17:45:43 +01:00