lkml.org 
[lkml]   [2007]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[2.6 patch] 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.

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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-07-29 16:59    [W:0.027 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site