Skip to content

Commit

Permalink
ASoC: rcar: fixup mod access before checking
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Nov 18, 2013
1 parent 9645083 commit 6020779
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions sound/soc/sh/rcar/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,13 @@ int rsnd_dai_connect(struct rsnd_dai *rdai,
struct rsnd_mod *mod,
struct rsnd_dai_stream *io)
{
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
struct device *dev = rsnd_priv_to_dev(priv);

if (!mod) {
dev_err(dev, "NULL mod\n");
if (!mod)
return -EIO;
}

if (!list_empty(&mod->list)) {
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
struct device *dev = rsnd_priv_to_dev(priv);

dev_err(dev, "%s%d is not empty\n",
rsnd_mod_name(mod),
rsnd_mod_id(mod));
Expand Down

0 comments on commit 6020779

Please sign in to comment.