summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorZidan Wang <zidan.wang@freescale.com>2015-11-27 11:08:20 +0800
committerNitin Garg <nitin.garg@nxp.com>2016-01-14 11:02:27 -0600
commit7a70ae1d3300f0d17fdd49d588d14568f0385d68 (patch)
tree2e936f95ea91ebc9fefec4aa7cacc72963619550 /sound
parentcdf937daa23cf5d0b0a3a90265f7d220b5e59522 (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')
-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 6c8f3b62b0e9..4c62a3d762ff 100644
--- a/sound/soc/fsl/imx-wm8962.c
+++ b/sound/soc/fsl/imx-wm8962.c
@@ -517,7 +517,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;
@@ -545,12 +545,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;
}
/*
@@ -568,14 +568,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: