summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/imx-wm8962.c
diff options
context:
space:
mode:
authorZidan Wang <zidan.wang@freescale.com>2015-11-27 11:08:20 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:50:00 +0800
commit5db31deedbe6944354932ae36cea5fba101c452e (patch)
tree4d58cd11a6c4ce71674244a976287ccfec6a116f /sound/soc/fsl/imx-wm8962.c
parentc47fb5a73d011f565fe0e062a77278fed735cce5 (diff)
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 <zidan.wang@freescale.com> (cherry picked from commit 8e27b90c9adf5033038a40e0b61a7ffe4c971290)
Diffstat (limited to 'sound/soc/fsl/imx-wm8962.c')
-rw-r--r--sound/soc/fsl/imx-wm8962.c10
1 files changed, 5 insertions, 5 deletions
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: