diff options
author | mckusick <mckusick@FreeBSD.org> | 2013-05-22 00:30:34 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2013-05-22 00:30:34 +0000 |
commit | ef9c2a57440d1b144dda56e91632cf15642a55b8 (patch) | |
tree | a26afcf895e9782c23c21f7f5943625abb2a4139 /sys/ufs | |
parent | 684e2dbe37c63ed670f482c2ceef57a05d8e84df (diff) | |
download | FreeBSD-src-ef9c2a57440d1b144dda56e91632cf15642a55b8.zip FreeBSD-src-ef9c2a57440d1b144dda56e91632cf15642a55b8.tar.gz |
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
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 8fd556e..af4f7c4 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -4984,13 +4984,14 @@ bmsafemap_lookup(mp, bp, cg, newbmsafemap) 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) { |