ASoC: imx-hdmi: Fix warning of the uninitialized variable ret

When condition ((hdmi_out && hdmi_in) || (!hdmi_out && !hdmi_in))
is true, then goto fail, the uninitialized variable ret will be
returned.

Signed-off-by: shengjiu wang <shengjiu.wang@nxp.com>
Reported-by: kernel test robot <lkp@intel.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Fixes: 6a5f850aa8 ("ASoC: fsl: Add imx-hdmi machine driver")
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/1608115464-18710-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
shengjiu wang 2020-12-16 18:44:24 +08:00 committed by Mark Brown
parent e49037ad12
commit acd894aee3
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0

View file

@ -164,6 +164,7 @@ static int imx_hdmi_probe(struct platform_device *pdev)
if ((hdmi_out && hdmi_in) || (!hdmi_out && !hdmi_in)) {
dev_err(&pdev->dev, "Invalid HDMI DAI link\n");
ret = -EINVAL;
goto fail;
}