diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2013-11-10 20:00:42 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-11-18 06:10:39 -0500 |
commit | 6020779b118f6221e5d067bd1e6b44bab6fc0276 (patch) | |
tree | 33e1917036c3192196146741d8c16451d5e2c6b0 /sound | |
parent | 9645083ca5ef365b7b750cf219bb20b61bb925f8 (diff) |
ASoC: rcar: fixup mod access before checking
rsnd_dai_connect() is using mod before NULL checking.
This patch fixes it up
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/sh/rcar/core.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index b234ed663073..2e09ee8d2500 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c | |||
@@ -279,15 +279,13 @@ int rsnd_dai_connect(struct rsnd_dai *rdai, | |||
279 | struct rsnd_mod *mod, | 279 | struct rsnd_mod *mod, |
280 | struct rsnd_dai_stream *io) | 280 | struct rsnd_dai_stream *io) |
281 | { | 281 | { |
282 | struct rsnd_priv *priv = rsnd_mod_to_priv(mod); | 282 | if (!mod) |
283 | struct device *dev = rsnd_priv_to_dev(priv); | ||
284 | |||
285 | if (!mod) { | ||
286 | dev_err(dev, "NULL mod\n"); | ||
287 | return -EIO; | 283 | return -EIO; |
288 | } | ||
289 | 284 | ||
290 | if (!list_empty(&mod->list)) { | 285 | if (!list_empty(&mod->list)) { |
286 | struct rsnd_priv *priv = rsnd_mod_to_priv(mod); | ||
287 | struct device *dev = rsnd_priv_to_dev(priv); | ||
288 | |||
291 | dev_err(dev, "%s%d is not empty\n", | 289 | dev_err(dev, "%s%d is not empty\n", |
292 | rsnd_mod_name(mod), | 290 | rsnd_mod_name(mod), |
293 | rsnd_mod_id(mod)); | 291 | rsnd_mod_id(mod)); |