public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] freevxfs: fix potential double brelse
@ 2023-08-18  9:14 Ferry Meng
  0 siblings, 0 replies; only message in thread
From: Ferry Meng @ 2023-08-18  9:14 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: LKML, Ferry Meng

Fix smatch warning:

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

Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>

diff --git a/fs/freevxfs/vxfs_bmap.c b/fs/freevxfs/vxfs_bmap.c
index de2a5bccb930..e2e143f182e1 100644
--- a/fs/freevxfs/vxfs_bmap.c
+++ b/fs/freevxfs/vxfs_bmap.c
@@ -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:
-- 
2.19.1.6.gb485710b


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-18  9:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-18  9:14 [PATCH] freevxfs: fix potential double brelse Ferry Meng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox