From 6732e1af29e7a264656289f514616454d18c2a19 Mon Sep 17 00:00:00 2001 From: Yifeng Zhao Date: Mon, 26 Aug 2024 14:18:22 +0800 Subject: [PATCH] exfat: fix memory leak in exfat_load_bitmap() Signed-off-by: Yifeng Zhao Change-Id: I50523d98e269dea3837bc520a7588bf245a01cd3 --- fs/exfat/balloc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/exfat/balloc.c b/fs/exfat/balloc.c index e918decb3735..54e93db1621a 100644 --- a/fs/exfat/balloc.c +++ b/fs/exfat/balloc.c @@ -110,10 +110,14 @@ int exfat_load_bitmap(struct super_block *sb) return -EIO; type = exfat_get_entry_type(ep); - if (type == TYPE_UNUSED) + if (type == TYPE_UNUSED) { + brelse(bh); break; - if (type != TYPE_BITMAP) + } + if (type != TYPE_BITMAP) { + brelse(bh); continue; + } if (ep->dentry.bitmap.flags == 0x0) { int err;