mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: perex@suse.cz
Cc: linux-kernel@vger.kernel.org
Subject: [2.6 patch] sound/synth/util_mem.c: remove pointless check
Date: Sun, 29 Jul 2007 16:55:49 +0200	[thread overview]
Message-ID: <20070729145549.GB16817@stusta.de> (raw)

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);


                 reply	other threads:[~2007-07-29 14:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070729145549.GB16817@stusta.de \
    --to=bunk@stusta.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®