Skip to contentSkip to conversation

ASoC: soc-cache: Avoid a redundant test for codec->reg_def_copy

PATCH New Axel Lin 1 participant 1 message Aug 20, 2011

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 ASoC: soc-cache: Avoid a redundant test for codec->reg_def_copy

---
 sound/soc/soc-cache.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
sound/soc/soc-cache.c +1 -3
index fdfd488..d620147 100644
@@ -727,13 +727,11 @@ static int snd_soc_lzo_cache_init(struct snd_soc_codec *codec)
 	 * and remember to free it afterwards.
 	 */
 	tofree = 0;
-	if (!codec->reg_def_copy)
-		tofree = 1;
-
 	if (!codec->reg_def_copy) {
 		codec->reg_def_copy = kzalloc(codec->reg_size, GFP_KERNEL);
 		if (!codec->reg_def_copy)
 			return -ENOMEM;
+		tofree = 1;
 	}
 
 	blkcount = snd_soc_lzo_block_count();
Signature · 1 line
1.7.4.1