Commit 6020779b authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: rcar: fixup mod access before checking

rsnd_dai_connect() is using mod before NULL checking.
This patch fixes it up
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 9645083c
......@@ -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));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment