All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs/ceph/file: fix memory leaks in __ceph_sync_read()
@ 2024-11-27 21:20 Max Kellermann
  2024-11-28 12:17 ` Alex Markuze
  0 siblings, 1 reply; 22+ messages in thread
From: Max Kellermann @ 2024-11-27 21:20 UTC (permalink / raw)
  To: amarkuze, xiubli, idryomov, ceph-devel, linux-kernel
  Cc: stable, Max Kellermann

In two `break` statements, the call to ceph_release_page_vector() was
missing, leaking the allocation from ceph_alloc_page_vector().

Cc: stable@vger.kernel.org
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
---
 fs/ceph/file.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 4b8d59ebda00..24d0f1cc9aac 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -1134,6 +1134,7 @@ ssize_t __ceph_sync_read(struct inode *inode, loff_t *ki_pos,
 			extent_cnt = __ceph_sparse_read_ext_count(inode, read_len);
 			ret = ceph_alloc_sparse_ext_map(op, extent_cnt);
 			if (ret) {
+				ceph_release_page_vector(pages, num_pages);
 				ceph_osdc_put_request(req);
 				break;
 			}
@@ -1168,6 +1169,7 @@ ssize_t __ceph_sync_read(struct inode *inode, loff_t *ki_pos,
 					op->extent.sparse_ext_cnt);
 			if (fret < 0) {
 				ret = fret;
+				ceph_release_page_vector(pages, num_pages);
 				ceph_osdc_put_request(req);
 				break;
 			}
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2024-12-06 12:50 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-27 21:20 [PATCH] fs/ceph/file: fix memory leaks in __ceph_sync_read() Max Kellermann
2024-11-28 12:17 ` Alex Markuze
2024-11-28 12:28   ` Max Kellermann
2024-11-28 12:31     ` Max Kellermann
2024-11-28 12:48       ` Alex Markuze
2024-11-28 13:11         ` Max Kellermann
2024-11-29  8:06   ` Max Kellermann
2024-12-05  8:32     ` Max Kellermann
2024-12-05 11:24       ` Ilya Dryomov
2024-12-05 11:31         ` Alex Markuze
2024-12-05 12:02           ` Max Kellermann
2024-12-05 12:17             ` Alex Markuze
2024-12-05 12:32               ` Max Kellermann
2024-12-05 12:22             ` Max Kellermann
2024-12-05 12:57               ` Alex Markuze
2024-12-05 13:08                 ` Max Kellermann
2024-12-05 15:12                   ` Ilya Dryomov
2024-12-05 15:37                     ` Max Kellermann
2024-12-05 15:42                       ` Max Kellermann
2024-12-05 15:49                     ` [PATCH v2] " Max Kellermann
2024-12-05 16:30                       ` Alex Markuze
2024-12-06 12:50                         ` Ilya Dryomov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.