linux-stable/sound/soc
Pierre-Louis Bossart d58970da32
ASoC: samsung: tm2_wm5110: check of of_parse return value
cppcheck warning:

sound/soc/samsung/tm2_wm5110.c:605:6: style: Variable 'ret' is
reassigned a value before the old one has been
used. [redundantAssignment]
 ret = devm_snd_soc_register_component(dev, &tm2_component,
     ^
sound/soc/samsung/tm2_wm5110.c:554:7: note: ret is assigned
  ret = of_parse_phandle_with_args(dev->of_node, "i2s-controller",
      ^
sound/soc/samsung/tm2_wm5110.c:605:6: note: ret is overwritten
 ret = devm_snd_soc_register_component(dev, &tm2_component,
     ^

The args is a stack variable, so it could have junk (uninitialized)
therefore args.np could have a non-NULL and random value even though
property was missing. Later could trigger invalid pointer dereference.

There's no need to check for args.np because args.np won't be
initialized on errors.

Fixes: 8d1513cef5 ("ASoC: samsung: Add support for HDMI audio on TM2 board")
Cc: <stable@vger.kernel.org>
Suggested-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312180231.2741-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-12 20:45:40 +00:00
..
adi ASoC: adi: sync parameter naming (rate/sample_bits) 2021-01-21 12:37:44 +00:00
amd ASoC: amd: renoir: remove invalid kernel-doc comment 2021-03-10 13:10:41 +00:00
atmel ASoC: mchp-i2s-mcc: Add FIFOs support 2021-03-10 13:08:39 +00:00
au1x ASoC: au1x: sync parameter naming (rate/sample_bits) 2021-01-21 12:37:46 +00:00
bcm ASoC: bcm: sync parameter naming (rate/sample_bits) 2021-01-21 12:37:47 +00:00
cirrus ASoC: cirrus: sync parameter naming (rate/sample_bits) 2021-01-21 12:37:48 +00:00
codecs ASoC: rt1015p: add acpi device id for rt1015p 2021-03-12 18:23:49 +00:00
dwc
fsl ASoC: fsl_xcvr: Use devm_platform_ioremap_resource_byname() to simplify code 2021-03-10 13:13:26 +00:00
generic ASoC: generic: simple-card-utils: remove useless assignment 2021-03-10 13:06:58 +00:00
hisilicon
img
intel ASoC: Intel: bytcr_rt5640: Enable jack-detect support on Asus T100TAF 2021-03-12 18:23:48 +00:00
jz4740 ASoC: jz4740: sync parameter naming (rate/sample_bits) 2021-01-21 12:38:08 +00:00
kirkwood ASoC: kirkwood: Use managed DMA buffer allocation 2021-01-13 11:36:16 +00:00
mediatek ASoC: mediatek: mt8173: rename local irq variable 2021-03-12 14:29:54 +00:00
meson ASoC: constify of_phandle_args in snd_soc_get_dai_name() 2021-03-10 13:07:14 +00:00
mxs ASoC: mxs-saif: drop unneeded snd_soc_dai_set_drvdata 2021-03-10 13:07:06 +00:00
pxa ASoC: mmp-sspa: drop unneeded snd_soc_dai_set_drvdata 2021-03-10 13:07:05 +00:00
qcom ASoC: qcom: q6dsp: fix kernel-doc warning 2021-03-10 13:10:44 +00:00
rockchip ASoC: rockchip: sync parameter naming (rate/sample_bits) 2021-01-21 12:37:50 +00:00
samsung ASoC: samsung: tm2_wm5110: check of of_parse return value 2021-03-12 20:45:40 +00:00
sh Merge series "ASoC: rsnd: cleanup ppcheck warning for Renesas sound driver" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>: 2021-03-10 13:08:35 +00:00
sof ASoC: SOF: Intel: hda: enable async suspend 2021-03-10 13:08:49 +00:00
spear
sprd ASoC: sprd: Switch to use list_entry_is_head() helper 2020-12-28 12:24:45 +00:00
sti
stm ASoC: stm32: i2s: add master clock provider 2021-02-05 15:03:03 +00:00
sunxi ASoC: sun4i-i2s: drop unneeded snd_soc_dai_set_drvdata 2021-03-10 13:07:07 +00:00
tegra ASoC: tegra: Add driver remove() callback 2021-02-08 11:39:51 +00:00
ti ASoC: ti: sync parameter naming (rate/sample_bits) 2021-01-21 12:37:53 +00:00
uniphier ASoC: uniphier: Simplify the return expression of uniphier_aio_startup 2021-03-10 13:07:15 +00:00
ux500
xilinx
xtensa
Kconfig ASoC: topology: KUnit: Add KUnit tests passing various arguments to snd_soc_tplg_component_load 2021-01-21 12:36:24 +00:00
Makefile ASoC: topology: KUnit: Add KUnit tests passing various arguments to snd_soc_tplg_component_load 2021-01-21 12:36:24 +00:00
soc-ac97.c
soc-acpi.c
soc-card.c
soc-component.c ASoC: constify of_phandle_args in snd_soc_get_dai_name() 2021-03-10 13:07:14 +00:00
soc-compress.c ASoC: soc-pcm: share DPCM BE DAI stop operation 2021-03-12 14:26:32 +00:00
soc-core.c ASoC: soc-core: fix DMI handling 2021-03-11 13:25:09 +00:00
soc-dai.c ASoC: soc-dai: fix kernel-doc 2021-03-10 13:08:46 +00:00
soc-dapm.c ASoC: dapm: use component prefix when checking widget names 2021-02-10 17:16:29 +00:00
soc-devres.c
soc-generic-dmaengine-pcm.c
soc-jack.c
soc-link.c ASoC: soc-pcm: care trigger rollback 2020-12-09 12:13:38 +00:00
soc-ops.c ASoC: soc-ops: remove useless assignment 2021-03-10 13:06:53 +00:00
soc-pcm.c ASoC: soc-pcm: share DPCM BE DAI stop operation 2021-03-12 14:26:32 +00:00
soc-topology-test.c ASoC: topology: KUnit: Convert from cpu to data format 2021-02-02 17:08:21 +00:00
soc-topology.c ASoC: soc-topology: clarify expression 2021-03-10 13:06:57 +00:00
soc-utils.c