Unverified Commit c48a4497 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Mark Brown
Browse files

ASoC: sma1307: fix uninitialized variable refence



When firmware loading is disabled, gcc warns that the local
'fw' variable fails to get initialized:

sound/soc/codecs/sma1307.c: In function 'sma1307_setting_loaded.isra':
sound/soc/codecs/sma1307.c:1717:12: error: 'fw' is used uninitialized [-Werror=uninitialized]
 1717 |         if (!fw) {
      |            ^
sound/soc/codecs/sma1307.c:1712:32: note: 'fw' was declared here
 1712 |         const struct firmware *fw;

Check the return code from request_firmware() to ensure that the
firmware is correctly set, and drop the incorrect release_firmware()
on that uninitialized data.

Fixes: 576c57e6 ("ASoC: sma1307: Add driver for Iron Device SMA1307")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20241113175734.2443315-1-arnd@kernel.org


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 07db6d5e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment