Skip to contentSkip to conversation

ASoC: soc-cache: Fix invalid memory access during snd_soc_lzo_cache_sync()

PATCH Applied Dimitris Papastamos 3 participants 3 messages Jan 11, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: soc-cache: Fix invalid memory access during snd_soc_lzo_cache_sync()

The size of the lzo syncing bitmap was incorrectly set to the size of the cache times the word size, however, the correct size is the size of the cache.

---
 sound/soc/soc-cache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/soc-cache.c +1 -1
index a9ebc07..8c2a21a 100644
@@ -1361,7 +1361,7 @@ static int snd_soc_lzo_cache_init(struct snd_soc_codec *codec)
 			goto err;
 		}
 		lzo_blocks[i]->sync_bmp = sync_bmp;
-		lzo_blocks[i]->sync_bmp_nbits = reg_size;
+		lzo_blocks[i]->sync_bmp_nbits = bmp_size;
 		/* alloc the working space for the compressed block */
 		ret = snd_soc_lzo_prepare(lzo_blocks[i]);
 		if (ret < 0)
Signature · 1 line
1.7.3.5
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Dimitris Papastamos

The size of the lzo syncing bitmap was incorrectly set to the size of the cache times the word size, however, the correct size is the size of the cache.

---
 sound/soc/soc-cache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/soc-cache.c +0 -0
index a9ebc07..8c2a21a 100644

sound/soc/soc-cache.c static int snd_soc_lzo_cache_init(struct snd_soc_codec *codec) · line 1367

Quoted 8 lines
sound/soc/soc-cache.c +1 -1
@@ -1361,7 +1361,7 @@ static int snd_soc_lzo_cache_init(struct snd_soc_codec *codec)
 			goto err;
 		}
 		lzo_blocks[i]->sync_bmp = sync_bmp;
-		lzo_blocks[i]->sync_bmp_nbits = reg_size;
+		lzo_blocks[i]->sync_bmp_nbits = bmp_size;
 		/* alloc the working space for the compressed block */
 		ret = snd_soc_lzo_prepare(lzo_blocks[i]);
 		if (ret < 0)
Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk