From: Kuninori Morimoto Date: Tue, 1 Dec 2015 08:31:38 +0000 (+0000) Subject: ASoC: rsnd: fixup wrong snd_soc_dai_driver pointer access X-Git-Tag: MMI-PSA29.97-13-9~8192^2~24^2~2^2~71 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2ff2ecca06d5302782c73626b841a509a9b01ef6;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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: Kuninori Morimoto Signed-off-by: Mark Brown --- diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index b187a8927e29..f1d7af114a31 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -603,7 +603,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv) struct device_node *playback, *capture; struct rsnd_dai_stream *io_playback; struct rsnd_dai_stream *io_capture; - struct snd_soc_dai_driver *drv; + struct snd_soc_dai_driver *rdrv, *drv; struct rsnd_dai *rdai; struct device *dev = rsnd_priv_to_dev(priv); int nr, dai_i, io_i, np_i; @@ -616,15 +616,15 @@ static int rsnd_dai_probe(struct rsnd_priv *priv) 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); - if (!drv || !rdai) { + if (!rdrv || !rdai) { ret = -ENOMEM; goto rsnd_dai_probe_done; } priv->rdai_nr = nr; - priv->daidrv = drv; + priv->daidrv = rdrv; priv->rdai = rdai; /* @@ -633,7 +633,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv) dai_i = 0; for_each_child_of_node(dai_node, dai_np) { rdai = rsnd_rdai_get(priv, dai_i); - drv = drv + dai_i; + drv = rdrv + dai_i; io_playback = &rdai->playback; io_capture = &rdai->capture;