[2/3] fs/fuse kio: fix sreq and msg leak in prepare_map_flush_ireq()

Submitted by Pavel Butsykin on Dec. 3, 2018, 1:02 p.m.

Details

Message ID 20181203130210.32011-3-pbutsykin@virtuozzo.com
State New
Series "Fuse KIO: fix fsync/flush loss"
Headers show

Commit Message

Pavel Butsykin Dec. 3, 2018, 1:02 p.m.
Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_map.c | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/kio/pcs/pcs_map.c b/fs/fuse/kio/pcs/pcs_map.c
index 4bd18c5224ab..1e700dff2043 100644
--- a/fs/fuse/kio/pcs/pcs_map.c
+++ b/fs/fuse/kio/pcs/pcs_map.c
@@ -3016,6 +3016,8 @@  static int prepare_map_flush_ireq(struct pcs_map_entry *m,
 	cslist_put(cslist);
 	if (!valid_for_flush(m, timer_sync) || m->cs_list != cslist) {
 		spin_unlock(&m->lock);
+		pcs_free_msg(msg);
+		ireq_destroy(sreq);
 		return 0;
 	}
 	prepare_map_flush_msg(m, sreq, msg);