Skip to contentSkip to conversation

sound/synth/util_mem.c: remove pointless check

PATCH New Adrian Bunk 1 participant 1 message Jul 29, 2007 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sound/synth/util_mem.c: remove pointless check

The Coverity checker spotted that if anyone would call this function with "prev == NULL", he would still get an Oops a few lines below.

---

sound/synth/util_mem.c renamed from sound/synth/util_mem.c.old +1 -1
@@ -112,15 +112,15 @@ __snd_util_memblk_new(struct snd_util_me
 	struct snd_util_memblk *blk;
 
 	blk = kmalloc(sizeof(struct snd_util_memblk) + hdr->block_extra_size,
 		      GFP_KERNEL);
 	if (blk == NULL)
 		return NULL;
 
-	if (! prev || prev == &hdr->block)
+	if (prev == &hdr->block)
 		blk->offset = 0;
 	else {
 		struct snd_util_memblk *p = get_memblk(prev);
 		blk->offset = p->offset + p->size;
 	}
 	blk->size = units;
 	list_add(&blk->list, prev);