summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorHaoxiang Li <haoxiang_li2024@163.com>2025-07-15 17:51:20 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-19 16:21:45 +0200
commit8df273ef0f5ad3830d74349cd4434418f1f98f76 (patch)
treefa88117a66c1f47e0d6d7552dcdd02c3ce1aa687 /fs
parent459d819648fe6aba524fee271fbf4cc158ef1eb8 (diff)
downloadlinux-8df273ef0f5ad3830d74349cd4434418f1f98f76.tar.gz
linux-8df273ef0f5ad3830d74349cd4434418f1f98f76.tar.bz2
linux-8df273ef0f5ad3830d74349cd4434418f1f98f76.zip
fs/ntfs3: Fix a resource leak bug in wnd_extend()
commit d68318471aa2e16222ebf492883e05a2d72b9b17 upstream. Add put_bh() to decrease the refcount of 'bh' after the job is finished, preventing a resource leak. Fixes: 3f3b442b5ad2 ("fs/ntfs3: Add bitmap") Cc: stable@vger.kernel.org Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ntfs3/bitmap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ntfs3/bitmap.c b/fs/ntfs3/bitmap.c
index 2c29a3b386ba..fb4d20d30838 100644
--- a/fs/ntfs3/bitmap.c
+++ b/fs/ntfs3/bitmap.c
@@ -1381,6 +1381,7 @@ int wnd_extend(struct wnd_bitmap *wnd, size_t new_bits)
mark_buffer_dirty(bh);
unlock_buffer(bh);
/* err = sync_dirty_buffer(bh); */
+ put_bh(bh);
b0 = 0;
bits -= op;