All of lore.kernel.org
 help / color / mirror / Atom feed
* e2fsprogs coverity patch <cid-3.diff>
@ 2007-02-10  2:11 Brian D. Behlendorf
  2007-03-18 14:09 ` e2fsprogs coverity patch <cid-03.diff> Theodore Tso
  0 siblings, 1 reply; 2+ messages in thread
From: Brian D. Behlendorf @ 2007-02-10  2:11 UTC (permalink / raw)
  To: tytso; +Cc: linux-ext4, adilger, behlendorf1, wartens2

Lawrence Livermore National Labs recently ran the source code
analysis tool Coverity over the e2fsprogs-1.39 source to see 
if it would identify any significant bugs.  The analysis
turned up 38 mostly minor issues which are enumerated here
with patches.  We went through and resolved these issues
but would love to see these mostly minor changes reviewed
and commited upstream.

Thanks,
Brian Behlendorf <behlendorf1@llnl.gov>, and
Herb Wartens <wartens2@llnl.gov>

-----------------------------------------------------------------------------
Coverity ID: 3: Deadcode

blkid_dev_has_tag() will immediately return -1 (an error if value is NULL. Thus
at the test later on value cannot be NULL. There are two possible ways to go
about fixing this. The first would be to remove the first NULL check for value.
The second one would be to remove the second check (and the deadcode). I could
be persuaded either way, but to preserve existing functionality I will opt to
remove the second check.

Index: e2fsprogs+chaos/lib/blkid/tag.c
===================================================================
--- e2fsprogs+chaos.orig/lib/blkid/tag.c
+++ e2fsprogs+chaos/lib/blkid/tag.c
@@ -91,8 +91,6 @@ extern int blkid_dev_has_tag(blkid_dev d
 		return -1;
 
 	tag = blkid_find_tag_dev(dev, type);
-	if (!value)
-		return(tag != NULL);
 	if (!tag || strcmp(tag->bit_val, value))
 		return 0;
 	return 1;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-18 14:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-10  2:11 e2fsprogs coverity patch <cid-3.diff> Brian D. Behlendorf
2007-03-18 14:09 ` e2fsprogs coverity patch <cid-03.diff> Theodore Tso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.