kernel_optimize_test/sound/soc/samsung
Pierre-Louis Bossart 7a7c14873c ASoC: samsung: tm2_wm5110: check of of_parse return value
commit d58970da324732686529655c21791cef0ee547c4 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-14 09:49:57 +02:00
..
aries_wm8994.c
arndale.c
bells.c
dma.h
dmaengine.c
h1940_uda1380.c
i2s-regs.h
i2s.c
i2s.h
idma.c
idma.h
jive_wm8750.c
Kconfig
littlemill.c
lowland.c
Makefile
midas_wm1811.c
neo1973_wm8753.c
odroid.c
pcm.c
pcm.h
regs-i2s-v2.h
regs-iis.h
rx1950_uda1380.c
s3c-i2s-v2.c
s3c-i2s-v2.h
s3c24xx_simtec_hermes.c
s3c24xx_simtec_tlv320aic23.c
s3c24xx_simtec.c
s3c24xx_simtec.h
s3c24xx_uda134x.c
s3c24xx-i2s.c
s3c24xx-i2s.h
s3c2412-i2s.c
s3c2412-i2s.h
smartq_wm8987.c
smdk_spdif.c
smdk_wm8580.c
smdk_wm8994.c
smdk_wm8994pcm.c
snow.c
spdif.c
spdif.h
speyside.c
tm2_wm5110.c
tobermory.c