cd9660: More "check for NULL" cleaunps.

Cleanup some checks for NULL. Most of these were always unnecessary and
starting with r294954 brelse() doesn't need any NULL checks at all.

For now keep the checks somewhat consistent with NetBSD in case we want to
merge the cleanups to older versions.
This commit is contained in:
Pedro F. Giffuni 2016-02-12 22:46:14 +00:00
parent eb3ff358dc
commit e296c1df6f

View File

@ -309,13 +309,13 @@ iso_mountfs(devvp, mp)
default:
break;
}
if (bp) {
if (bp != NULL) {
brelse(bp);
bp = NULL;
}
}
vd_end:
if (bp) {
if (bp != NULL) {
brelse(bp);
bp = NULL;
}
@ -474,11 +474,11 @@ iso_mountfs(devvp, mp)
return 0;
out:
if (bp)
if (bp != NULL)
brelse(bp);
if (pribp)
if (pribp != NULL)
brelse(pribp);
if (supbp)
if (supbp != NULL)
brelse(supbp);
if (cp != NULL) {
DROP_GIANT();
@ -751,8 +751,7 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, isodir)
#if 0
if (isonum_733(isodir->extent) +
isonum_711(isodir->ext_attr_length) != ifhp->ifid_start) {
if (bp != 0)
brelse(bp);
brelse(bp);
printf("fhtovp: file start miss %d vs %d\n",
isonum_733(isodir->extent) + isonum_711(isodir->ext_attr_length),
ifhp->ifid_start);
@ -770,7 +769,7 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, isodir)
* read the `.' entry out of a dir.
*/
ip->iso_start = ino >> imp->im_bshift;
if (bp != 0)
if (bp != NULL)
brelse(bp);
if ((error = cd9660_blkatoff(vp, (off_t)0, NULL, &bp)) != 0) {
vput(vp);
@ -809,8 +808,7 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, isodir)
break;
}
if (bp != 0)
brelse(bp);
brelse(bp);
/*
* Initialize the associated vnode