bugfix in BUG_ON use: actually catch bad use of unionfs_mntput
authorErez_Zadok <ezk@cs.sunysb.edu>
Fri, 11 May 2007 05:51:48 +0000 (01:51 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Sat, 16 Aug 2014 02:26:04 +0000 (22:26 -0400)
fs/unionfs/union.h

index 36522773119c23fe95ef3edb0197adb8b2708bdc..9b54ed5a41bac0989bdd445d2e4ca2b03ffff04c 100644 (file)
@@ -480,13 +480,13 @@ static inline void unionfs_mntput(struct dentry *dentry, int bindex)
        if (!dentry) {
                if (bindex < 0)
                        return;
-               BUG_ON(dentry && bindex < 0);
+               BUG_ON(!dentry && bindex >= 0);
        }
        mnt = unionfs_lower_mnt_idx(dentry, bindex);
        if (!mnt) {
                if (bindex < 0)
                        return;
-               BUG_ON(mnt && bindex < 0);
+               BUG_ON(!mnt && bindex >= 0);
        }
        mntput(mnt);
 }