* [PATCH] ASoC: Fix soc-cache buffer overflow bug
@ 2010-09-21 13:12 Dimitris Papastamos
2010-09-21 13:21 ` Mark Brown
2010-09-21 17:43 ` Mark Brown
0 siblings, 2 replies; 4+ messages in thread
From: Dimitris Papastamos @ 2010-09-21 13:12 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, patches
Make sure we stay within the cache boundaries when updating the
register cache.
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
sound/soc/soc-cache.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index 1228111..28bf1ff 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -203,8 +203,9 @@ static int snd_soc_8_16_write(struct snd_soc_codec *codec, unsigned int reg,
data[1] = (value >> 8) & 0xff;
data[2] = value & 0xff;
- if (!snd_soc_codec_volatile_register(codec, reg))
- reg_cache[reg] = value;
+ if (!snd_soc_codec_volatile_register(codec, reg)
+ && reg < codec->driver->reg_cache_size)
+ reg_cache[reg] = value;
if (codec->cache_only) {
codec->cache_sync = 1;
--
1.7.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: Fix soc-cache buffer overflow bug
2010-09-21 13:12 [PATCH] ASoC: Fix soc-cache buffer overflow bug Dimitris Papastamos
@ 2010-09-21 13:21 ` Mark Brown
2010-09-21 14:36 ` Liam Girdwood
2010-09-21 17:43 ` Mark Brown
1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2010-09-21 13:21 UTC (permalink / raw)
To: Dimitris Papastamos; +Cc: alsa-devel, patches, Liam Girdwood
On Tue, Sep 21, 2010 at 02:12:35PM +0100, Dimitris Papastamos wrote:
> Make sure we stay within the cache boundaries when updating the
> register cache.
>
> Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
OK, will wait for Liam's review before applying but as discussed
off-line please also do a version of this patch that applies to
2.6.36-rc since it's a bug fix.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: Fix soc-cache buffer overflow bug
2010-09-21 13:21 ` Mark Brown
@ 2010-09-21 14:36 ` Liam Girdwood
0 siblings, 0 replies; 4+ messages in thread
From: Liam Girdwood @ 2010-09-21 14:36 UTC (permalink / raw)
To: Mark Brown; +Cc: Dimitris Papastamos, alsa-devel, patches
On Tue, 2010-09-21 at 14:21 +0100, Mark Brown wrote:
> On Tue, Sep 21, 2010 at 02:12:35PM +0100, Dimitris Papastamos wrote:
> > Make sure we stay within the cache boundaries when updating the
> > register cache.
> >
> > Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
>
> OK, will wait for Liam's review before applying but as discussed
> off-line please also do a version of this patch that applies to
> 2.6.36-rc since it's a bug fix.
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: Fix soc-cache buffer overflow bug
2010-09-21 13:12 [PATCH] ASoC: Fix soc-cache buffer overflow bug Dimitris Papastamos
2010-09-21 13:21 ` Mark Brown
@ 2010-09-21 17:43 ` Mark Brown
1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2010-09-21 17:43 UTC (permalink / raw)
To: Dimitris Papastamos; +Cc: alsa-devel, patches, Liam Girdwood
On Tue, Sep 21, 2010 at 02:12:35PM +0100, Dimitris Papastamos wrote:
> Make sure we stay within the cache boundaries when updating the
> register cache.
>
> Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-09-21 17:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-21 13:12 [PATCH] ASoC: Fix soc-cache buffer overflow bug Dimitris Papastamos
2010-09-21 13:21 ` Mark Brown
2010-09-21 14:36 ` Liam Girdwood
2010-09-21 17:43 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.