Skip to contentSkip to conversation

freevxfs: fix potential double brelse

PATCH New Ferry Meng 1 participant 1 message Aug 18, 2023

lore
Share & tools
lore

Ferry Meng

author
#0 lore raw

PATCH 1/1 freevxfs: fix potential double brelse

Fix smatch warning:

fs/freevxfs/vxfs_bmap.c:170 vxfs_bmap_indir() warn: passing freed memory 'bp'

fs/freevxfs/vxfs_bmap.c +2 -0
index de2a5bccb930..e2e143f182e1 100644
@@ -126,6 +126,7 @@ vxfs_bmap_indir(struct inode *ip, long indir, int size, long block)
 
 		if (block < off) {
 			brelse(bp);
+			bp = NULL;
 			continue;
 		}
 
@@ -162,6 +163,7 @@ vxfs_bmap_indir(struct inode *ip, long indir, int size, long block)
 			BUG();
 		}
 		brelse(bp);
+		bp = NULL;
 	}
 
 fail:
Signature · 1 line
2.19.1.6.gb485710b