diff options
author | Xiubo Li <Li.Xiubo@freescale.com> | 2014-01-09 04:49:40 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-01-09 12:38:09 -0500 |
commit | 34787d0a258ebb3686676fb37a9e8717cbdd835a (patch) | |
tree | 0e6b774d5bd2ae2122c019afa81afd39f3066d8e /sound/soc/generic | |
parent | 708ec0241c56b85176937e79314430f4f71e40c6 (diff) |
ASoC: simple-card: fix the cinfo error check
If the dt is used and the cinfo is NULL, the -ENOMEM should be return.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/generic')
-rw-r--r-- | sound/soc/generic/simple-card.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 6c61b1758f78..11030a63b811 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c | |||
@@ -211,15 +211,17 @@ static int asoc_simple_card_probe(struct platform_device *pdev) | |||
211 | dev_err(dev, "parse error %d\n", ret); | 211 | dev_err(dev, "parse error %d\n", ret); |
212 | return ret; | 212 | return ret; |
213 | } | 213 | } |
214 | } else { | ||
215 | return -ENOMEM; | ||
214 | } | 216 | } |
215 | } else { | 217 | } else { |
216 | cinfo = pdev->dev.platform_data; | 218 | cinfo = pdev->dev.platform_data; |
217 | cinfo->snd_card.dev = &pdev->dev; | 219 | if (!cinfo) { |
218 | } | 220 | dev_err(dev, "no info for asoc-simple-card\n"); |
221 | return -EINVAL; | ||
222 | } | ||
219 | 223 | ||
220 | if (!cinfo) { | 224 | cinfo->snd_card.dev = &pdev->dev; |
221 | dev_err(dev, "no info for asoc-simple-card\n"); | ||
222 | return -EINVAL; | ||
223 | } | 225 | } |
224 | 226 | ||
225 | if (!cinfo->name || | 227 | if (!cinfo->name || |