diff options
author | mckusick <mckusick@FreeBSD.org> | 2013-05-22 00:57:22 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2013-05-22 00:57:22 +0000 |
commit | cac87f28129c2d54082b548b3c6172892aae7f8a (patch) | |
tree | ba94bde8e1a1c8fbc10a9c1bf1733722330fd58c /sys | |
parent | a03c74092a80a96016ce07d24e923ed39ca26a7d (diff) | |
download | FreeBSD-src-cac87f28129c2d54082b548b3c6172892aae7f8a.zip FreeBSD-src-cac87f28129c2d54082b548b3c6172892aae7f8a.tar.gz |
Add missing buffer releases (brelse) after bread calls that return
an error. One could argue that returning a buffer even when it is
not valid is incorrect, but bread has always returned a buffer
valid or not.
Reviewed by: kib
MFC after: 2 weeks
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index fcec27a..11db201 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -9362,13 +9362,16 @@ clear_unlinked_inodedep(inodedep) if (idp && (idp->id_state & UNLINKNEXT)) pino = idp->id_ino; FREE_LOCK(&lk); - if (pino == 0) + if (pino == 0) { bp = getblk(ump->um_devvp, btodb(fs->fs_sblockloc), (int)fs->fs_sbsize, 0, 0, 0); - else + } else { error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, pino)), (int)fs->fs_bsize, NOCRED, &bp); + if (error) + brelse(bp); + } ACQUIRE_LOCK(&lk); if (error) break; @@ -13183,6 +13186,7 @@ softdep_inode_append(ip, cred, wkhd) error = bread(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), (int)fs->fs_bsize, cred, &bp); if (error) { + bqrelse(bp); softdep_freework(wkhd); return; } |