lkml.org 
[lkml]   [2023]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] freevxfs: fix potential double brelse
Date
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
\
 
 \ /
  Last update: 2023-08-18 11:17    [W:0.044 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site