mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [2.6 patch] sound/synth/util_mem.c: remove pointless check
@ 2007-07-29 14:55 Adrian Bunk
  0 siblings, 0 replies; only message in thread
From: Adrian Bunk @ 2007-07-29 14:55 UTC (permalink / raw)
  To: perex; +Cc: linux-kernel

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

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

--- linux-2.6.22-rc6-mm1/sound/synth/util_mem.c.old	2007-07-24 19:37:50.000000000 +0200
+++ linux-2.6.22-rc6-mm1/sound/synth/util_mem.c	2007-07-24 19:38:37.000000000 +0200
@@ -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);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-29 14:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-29 14:55 [2.6 patch] sound/synth/util_mem.c: remove pointless check Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®