From: Arnd Bergmann <arnd@arndb.de>
Clang points out a code path that returns an undefined value
in an error case:
sound/soc/fsl/imx-hdmi.c:165:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsom
etimes-uninitialized]
if ((hdmi_out && hdmi_in) || (!hdmi_out && !hdmi_in)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/fsl/imx-hdmi.c:212:9: note: uninitialized use occurs here
return ret;
The driver returns -EINVAL for other broken DT properties, so do
it the same way here.
Fixes: 6a5f850aa83a ("ASoC: fsl: Add imx-hdmi machine driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
sound/soc/fsl/imx-hdmi.c | 1 +
1 file changed, 1 insertion(+)
On Wed, Dec 30, 2020 at 04:44:15PM +0100, Arnd Bergmann wrote:
From: Arnd Bergmann <arnd@arndb.de>
Clang points out a code path that returns an undefined value
in an error case:
sound/soc/fsl/imx-hdmi.c:165:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsom
etimes-uninitialized]
if ((hdmi_out && hdmi_in) || (!hdmi_out && !hdmi_in)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/fsl/imx-hdmi.c:212:9: note: uninitialized use occurs here
return ret;
The driver returns -EINVAL for other broken DT properties, so do
it the same way here.
Fixes: 6a5f850aa83a ("ASoC: fsl: Add imx-hdmi machine driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
On Wed, Dec 30, 2020 at 04:44:15PM +0100, Arnd Bergmann wrote:
quoted hunk
From: Arnd Bergmann <arnd@arndb.de>
Clang points out a code path that returns an undefined value
in an error case:
sound/soc/fsl/imx-hdmi.c:165:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsom
etimes-uninitialized]
if ((hdmi_out && hdmi_in) || (!hdmi_out && !hdmi_in)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/fsl/imx-hdmi.c:212:9: note: uninitialized use occurs here
return ret;
The driver returns -EINVAL for other broken DT properties, so do
it the same way here.
Fixes: 6a5f850aa83a ("ASoC: fsl: Add imx-hdmi machine driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
sound/soc/fsl/imx-hdmi.c | 1 +
1 file changed, 1 insertion(+)