diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2013-09-25 09:22:01 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-26 07:01:32 -0400 |
commit | 50d4a790e65f5ac91a7b2720a19e80e862b40318 (patch) | |
tree | 7b036ab65805090e553758edd1f82851ec306cb9 /sound/soc/fsl | |
parent | a8b22c1ccccd2a5368f803afab41b4301832ff10 (diff) |
ASoC: imx-sgtl5000: Fix uninitialized pointer use in error path
This patch avoids to dereference the uninitialized data pointer if the
error path is entered before devm_kzalloc is called (or if the allocation
fails). It fixes the following warning:
sound/soc/fsl/imx-sgtl5000.c: In function 'imx_sgtl5000_probe':
sound/soc/fsl/imx-sgtl5000.c:175:18: warning: 'data' may be used uninitialized in this function [-Wmaybe-uninitialized]
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r-- | sound/soc/fsl/imx-sgtl5000.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c index 52df7d5eaf9e..ca1be1d9dcf0 100644 --- a/sound/soc/fsl/imx-sgtl5000.c +++ b/sound/soc/fsl/imx-sgtl5000.c | |||
@@ -62,7 +62,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) | |||
62 | struct device_node *ssi_np, *codec_np; | 62 | struct device_node *ssi_np, *codec_np; |
63 | struct platform_device *ssi_pdev; | 63 | struct platform_device *ssi_pdev; |
64 | struct i2c_client *codec_dev; | 64 | struct i2c_client *codec_dev; |
65 | struct imx_sgtl5000_data *data; | 65 | struct imx_sgtl5000_data *data = NULL; |
66 | int int_port, ext_port; | 66 | int int_port, ext_port; |
67 | int ret; | 67 | int ret; |
68 | 68 | ||
@@ -172,7 +172,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) | |||
172 | return 0; | 172 | return 0; |
173 | 173 | ||
174 | fail: | 174 | fail: |
175 | if (!IS_ERR(data->codec_clk)) | 175 | if (data && !IS_ERR(data->codec_clk)) |
176 | clk_put(data->codec_clk); | 176 | clk_put(data->codec_clk); |
177 | if (ssi_np) | 177 | if (ssi_np) |
178 | of_node_put(ssi_np); | 178 | of_node_put(ssi_np); |