Commit 2ff2ecca authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: rsnd: fixup wrong snd_soc_dai_driver pointer access

drv pointer should be "base + offset" instead of
"current + offset". This patch fixup this issue, otherwise
third and subsequent pointer will be broken
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 186fadc1
...@@ -603,7 +603,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv) ...@@ -603,7 +603,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv)
struct device_node *playback, *capture; struct device_node *playback, *capture;
struct rsnd_dai_stream *io_playback; struct rsnd_dai_stream *io_playback;
struct rsnd_dai_stream *io_capture; struct rsnd_dai_stream *io_capture;
struct snd_soc_dai_driver *drv; struct snd_soc_dai_driver *rdrv, *drv;
struct rsnd_dai *rdai; struct rsnd_dai *rdai;
struct device *dev = rsnd_priv_to_dev(priv); struct device *dev = rsnd_priv_to_dev(priv);
int nr, dai_i, io_i, np_i; int nr, dai_i, io_i, np_i;
...@@ -616,15 +616,15 @@ static int rsnd_dai_probe(struct rsnd_priv *priv) ...@@ -616,15 +616,15 @@ static int rsnd_dai_probe(struct rsnd_priv *priv)
goto rsnd_dai_probe_done; goto rsnd_dai_probe_done;
} }
drv = devm_kzalloc(dev, sizeof(*drv) * nr, GFP_KERNEL); rdrv = devm_kzalloc(dev, sizeof(*rdrv) * nr, GFP_KERNEL);
rdai = devm_kzalloc(dev, sizeof(*rdai) * nr, GFP_KERNEL); rdai = devm_kzalloc(dev, sizeof(*rdai) * nr, GFP_KERNEL);
if (!drv || !rdai) { if (!rdrv || !rdai) {
ret = -ENOMEM; ret = -ENOMEM;
goto rsnd_dai_probe_done; goto rsnd_dai_probe_done;
} }
priv->rdai_nr = nr; priv->rdai_nr = nr;
priv->daidrv = drv; priv->daidrv = rdrv;
priv->rdai = rdai; priv->rdai = rdai;
/* /*
...@@ -633,7 +633,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv) ...@@ -633,7 +633,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv)
dai_i = 0; dai_i = 0;
for_each_child_of_node(dai_node, dai_np) { for_each_child_of_node(dai_node, dai_np) {
rdai = rsnd_rdai_get(priv, dai_i); rdai = rsnd_rdai_get(priv, dai_i);
drv = drv + dai_i; drv = rdrv + dai_i;
io_playback = &rdai->playback; io_playback = &rdai->playback;
io_capture = &rdai->capture; io_capture = &rdai->capture;
......
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