瀏覽代碼

[GFS2] Plug an unlikely leak

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Bob Peterson 17 年之前
父節點
當前提交
3ad62e87cd
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      fs/gfs2/lops.c

+ 3 - 1
fs/gfs2/lops.c

@@ -404,8 +404,10 @@ static int revoke_lo_scan_elements(struct gfs2_jdesc *jd, unsigned int start,
 			blkno = be64_to_cpu(*(__be64 *)(bh->b_data + offset));
 			blkno = be64_to_cpu(*(__be64 *)(bh->b_data + offset));
 
 
 			error = gfs2_revoke_add(sdp, blkno, start);
 			error = gfs2_revoke_add(sdp, blkno, start);
-			if (error < 0)
+			if (error < 0) {
+				brelse(bh);
 				return error;
 				return error;
+			}
 			else if (error)
 			else if (error)
 				sdp->sd_found_revokes++;
 				sdp->sd_found_revokes++;