alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.36] ASoC: Fix soc-cache buffer overflow bug
@ 2010-09-21 14:03 Dimitris Papastamos
  2010-09-22 11:02 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Dimitris Papastamos @ 2010-09-21 14:03 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 adbc68c..15d2779 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] 2+ messages in thread

* Re: [PATCH 2.6.36] ASoC: Fix soc-cache buffer overflow bug
  2010-09-21 14:03 [PATCH 2.6.36] ASoC: Fix soc-cache buffer overflow bug Dimitris Papastamos
@ 2010-09-22 11:02 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2010-09-22 11:02 UTC (permalink / raw)
  To: Dimitris Papastamos; +Cc: alsa-devel, patches, Liam Girdwood

On Tue, Sep 21, 2010 at 03:03:26PM +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] 2+ messages in thread

end of thread, other threads:[~2010-09-22 11:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-21 14:03 [PATCH 2.6.36] ASoC: Fix soc-cache buffer overflow bug Dimitris Papastamos
2010-09-22 11:02 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).