Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 May 2013 00:30:34 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r250892 - head/sys/ufs/ffs
Message-ID:  <201305220030.r4M0UYef031246@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckusick
Date: Wed May 22 00:30:34 2013
New Revision: 250892
URL: http://svnweb.freebsd.org/changeset/base/250892

Log:
  Remove a bogus check for a NULL buffer pointer.
  Add a KASSERT that it is not NULL.
  
  Found by:    Coverity Scan, CID 1009114
  Reviewed by: kib
  MFC after:   2 weeks

Modified:
  head/sys/ufs/ffs/ffs_softdep.c

Modified: head/sys/ufs/ffs/ffs_softdep.c
==============================================================================
--- head/sys/ufs/ffs/ffs_softdep.c	Wed May 22 00:17:50 2013	(r250891)
+++ head/sys/ufs/ffs/ffs_softdep.c	Wed May 22 00:30:34 2013	(r250892)
@@ -4984,13 +4984,14 @@ bmsafemap_lookup(mp, bp, cg, newbmsafema
 	struct fs *fs;
 
 	mtx_assert(&lk, MA_OWNED);
-	if (bp)
-		LIST_FOREACH(wk, &bp->b_dep, wk_list)
-			if (wk->wk_type == D_BMSAFEMAP) {
-				if (newbmsafemap)
-					WORKITEM_FREE(newbmsafemap,D_BMSAFEMAP);
-				return (WK_BMSAFEMAP(wk));
-			}
+	KASSERT(bp != NULL, ("bmsafemap_lookup: missing buffer"));
+	LIST_FOREACH(wk, &bp->b_dep, wk_list) {
+		if (wk->wk_type == D_BMSAFEMAP) {
+			if (newbmsafemap)
+				WORKITEM_FREE(newbmsafemap, D_BMSAFEMAP);
+			return (WK_BMSAFEMAP(wk));
+		}
+	}
 	fs = VFSTOUFS(mp)->um_fs;
 	bmsafemaphd = BMSAFEMAP_HASH(fs, cg);
 	if (bmsafemap_find(bmsafemaphd, mp, cg, &bmsafemap) == 1) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305220030.r4M0UYef031246>