summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-02-12 22:46:14 +0000
committerpfg <pfg@FreeBSD.org>2016-02-12 22:46:14 +0000
commite9b92972cc5f394a34940e6d44b9722f1c9f34ac (patch)
treef4bc581087b5c5283cd62b4336248e0bcfdfe4c1 /sys/fs
parent67a2e23340077429048389841a1d138a4e6b2b69 (diff)
downloadFreeBSD-src-e9b92972cc5f394a34940e6d44b9722f1c9f34ac.zip
FreeBSD-src-e9b92972cc5f394a34940e6d44b9722f1c9f34ac.tar.gz
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.
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/cd9660/cd9660_vfsops.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c
index 983b869..bf18094 100644
--- a/sys/fs/cd9660/cd9660_vfsops.c
+++ b/sys/fs/cd9660/cd9660_vfsops.c
@@ -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
OpenPOWER on IntegriCloud