Author: cem
Date: Thu Sep  5 21:30:52 2019
New Revision: 351898
URL: https://svnweb.freebsd.org/changeset/base/351898

Log:
  msdosfs: Drop an unneeded brelse in bread error condition
  
  After r294954, it is an invariant that bread returns non-NULL bp if and only
  if the routine succeeded.  On error, it handles any buffer cleanup
  internally.  So the brelse(NULL) here was just redundant.
  
  No functional change.
  
  Discussed with:       kib (extracted from a larger differential)

Modified:
  head/sys/fs/msdosfs/msdosfs_fat.c

Modified: head/sys/fs/msdosfs/msdosfs_fat.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_fat.c   Thu Sep  5 20:51:41 2019        
(r351897)
+++ head/sys/fs/msdosfs/msdosfs_fat.c   Thu Sep  5 21:30:52 2019        
(r351898)
@@ -1145,10 +1145,8 @@ markvoldirty(struct msdosfsmount *pmp, int dirty)
        byteoffset = FATOFS(pmp, 1);
        fatblock(pmp, byteoffset, &bn, &bsize, &bo);
        error = bread(pmp->pm_devvp, bn, bsize, NOCRED, &bp);
-       if (error) {
-               brelse(bp);
+       if (error)
                return (error);
-       }
 
        /*
         * Get the current value of the FAT entry and set/clear the relevant
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to