linux-stable/sound
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
..
ac97 ALSA: ac97: Constify static struct attribute_group 2021-01-31 09:49:58 +01:00
aoa ALSA: Convert strlcpy to strscpy when return value is unused 2021-01-08 09:30:05 +01:00
arm ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
atmel
core ASoC: Updates for v5.12 2021-02-17 21:16:27 +01:00
drivers ALSA: Convert strlcpy to strscpy when return value is unused 2021-01-08 09:30:05 +01:00
firewire ALSA: fireface: fix to parse sync status register of latter protocol 2021-02-08 15:58:36 +01:00
hda ALSA/ASoC/SOF/SoundWire: fix Kconfig issues 2021-03-02 18:30:07 +01:00
i2c ALSA: Convert strlcpy to strscpy when return value is unused 2021-01-08 09:30:05 +01:00
isa isa: Make the remove callback for isa drivers return void 2021-01-26 07:51:48 +01:00
mips ALSA: n64: Fix return value check in n64audio_probe() 2021-02-25 10:29:13 +01:00
oss ALSA: Convert strlcpy to strscpy when return value is unused 2021-01-08 09:30:05 +01:00
parisc
pci ALSA: hda/realtek: Apply dual codec quirks for MSI Godlike X570 board 2021-03-03 15:25:03 +01:00
pcmcia
ppc ALSA: Convert strlcpy to strscpy when return value is unused 2021-01-08 09:30:05 +01:00
sh
soc ASoC: samsung: tm2_wm5110: check of of_parse return value 2021-03-12 20:45:40 +00:00
sparc ALSA: sparc: dbri: fix repeated word 'the' 2020-10-17 09:58:35 +02:00
spi
synth
usb ALSA: usb-audio: Fix Pioneer DJM devices URB_CONTROL request direction to set samplerate 2021-03-01 15:44:53 +01:00
x86 ALSA: x86: Simplify with dma_set_mask_and_coherent() 2021-01-15 11:17:19 +01:00
xen ALSA: Convert strlcpy to strscpy when return value is unused 2021-01-08 09:30:05 +01:00
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c