From 5db31deedbe6944354932ae36cea5fba101c452e Mon Sep 17 00:00:00 2001 From: Zidan Wang Date: Fri, 27 Nov 2015 11:08:20 +0800 Subject: MLK-11915-02 ASoC: imx-wm8962: init codec_np to avoid wild pointer init codec_np to avoid wild pointer. Reported by Coverity. Signed-off-by: Zidan Wang (cherry picked from commit 8e27b90c9adf5033038a40e0b61a7ffe4c971290) --- sound/soc/fsl/imx-wm8962.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sound/soc/fsl/imx-wm8962.c') diff --git a/sound/soc/fsl/imx-wm8962.c b/sound/soc/fsl/imx-wm8962.c index 0784c00a9ef0..03c32dd58231 100644 --- a/sound/soc/fsl/imx-wm8962.c +++ b/sound/soc/fsl/imx-wm8962.c @@ -522,7 +522,7 @@ static int be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, static int imx_wm8962_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; - struct device_node *cpu_np, *codec_np; + struct device_node *cpu_np, *codec_np = NULL; struct platform_device *cpu_pdev; struct imx_priv *priv = &card_priv; struct i2c_client *codec_dev; @@ -550,12 +550,12 @@ static int imx_wm8962_probe(struct platform_device *pdev) ret = of_property_read_u32(np, "mux-int-port", &int_port); if (ret) { dev_err(&pdev->dev, "mux-int-port missing or invalid\n"); - return ret; + goto fail; } ret = of_property_read_u32(np, "mux-ext-port", &ext_port); if (ret) { dev_err(&pdev->dev, "mux-ext-port missing or invalid\n"); - return ret; + goto fail; } /* @@ -573,14 +573,14 @@ static int imx_wm8962_probe(struct platform_device *pdev) IMX_AUDMUX_V2_PDCR_RXDSEL(ext_port)); if (ret) { dev_err(&pdev->dev, "audmux internal port setup failed\n"); - return ret; + goto fail; } ret = imx_audmux_v2_configure_port(ext_port, IMX_AUDMUX_V2_PTCR_SYN, IMX_AUDMUX_V2_PDCR_RXDSEL(int_port)); if (ret) { dev_err(&pdev->dev, "audmux external port setup failed\n"); - return ret; + goto fail; } audmux_bypass: -- cgit v1.2.3