diff options
author | Nicolin Chen <Guangyu.Chen@freescale.com> | 2014-04-18 02:12:34 -0400 |
---|---|---|
committer | Nicolin Chen <Guangyu.Chen@freescale.com> | 2014-04-18 02:24:40 -0400 |
commit | cc678a578ef873127b8237680282f1cd55fe1873 (patch) | |
tree | 94aef7ffe5887b7f6691b59dbf488fd779f7246a /sound | |
parent | 19257e67b9e505366a8a1b572a0e7c0ddbe1d8d5 (diff) |
ENGR00309297-1 ASoC: imx-cs42888: Error out if failed to get p2p params
There's a possiblity that ASRC P2P would error out during its probe() due to
missing some DT bindings for example. If that happens, this asrc_p2p would
be a NULL pointer and accessing it would cause Kernel Panic.
Thus this patch adds an error out here to keep it safe.
Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/fsl/imx-cs42888.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/fsl/imx-cs42888.c b/sound/soc/fsl/imx-cs42888.c index db9f58d89868..a56f4f1984ed 100644 --- a/sound/soc/fsl/imx-cs42888.c +++ b/sound/soc/fsl/imx-cs42888.c | |||
@@ -247,6 +247,11 @@ static int imx_cs42888_probe(struct platform_device *pdev) | |||
247 | if (asrc_pdev) { | 247 | if (asrc_pdev) { |
248 | struct fsl_asrc_p2p *asrc_p2p; | 248 | struct fsl_asrc_p2p *asrc_p2p; |
249 | asrc_p2p = platform_get_drvdata(asrc_pdev); | 249 | asrc_p2p = platform_get_drvdata(asrc_pdev); |
250 | if (!asrc_p2p) { | ||
251 | dev_err(&pdev->dev, "failed to get p2p params\n"); | ||
252 | ret = -EINVAL; | ||
253 | goto fail; | ||
254 | } | ||
250 | asrc_p2p->per_dev = ESAI; | 255 | asrc_p2p->per_dev = ESAI; |
251 | priv->fe_p2p_rate = asrc_p2p->p2p_rate; | 256 | priv->fe_p2p_rate = asrc_p2p->p2p_rate; |
252 | priv->fe_p2p_width = asrc_p2p->p2p_width; | 257 | priv->fe_p2p_width = asrc_p2p->p2p_width; |