[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210520154654.1791183-2-groug@kaod.org>
Date: Thu, 20 May 2021 17:46:50 +0200
From: Greg Kurz <groug@...d.org>
To: Miklos Szeredi <miklos@...redi.hu>
Cc: virtualization@...ts.linux-foundation.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
virtio-fs@...hat.com, Stefan Hajnoczi <stefanha@...hat.com>,
Max Reitz <mreitz@...hat.com>, Vivek Goyal <vgoyal@...hat.com>,
Greg Kurz <groug@...d.org>
Subject: [PATCH v4 1/5] fuse: Fix leak in fuse_dentry_automount() error path
Some rollback was forgotten during the addition of crossmounts.
Fixes: bf109c64040f ("fuse: implement crossmounts")
Cc: mreitz@...hat.com
Signed-off-by: Greg Kurz <groug@...d.org>
---
fs/fuse/dir.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 1b6c001a7dd1..fb2af70596c3 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -339,8 +339,11 @@ static struct vfsmount *fuse_dentry_automount(struct path *path)
/* Initialize superblock, making @mp_fi its root */
err = fuse_fill_super_submount(sb, mp_fi);
- if (err)
+ if (err) {
+ fuse_conn_put(fc);
+ kfree(fm);
goto out_put_sb;
+ }
sb->s_flags |= SB_ACTIVE;
fsc->root = dget(sb->s_root);
--
2.26.3
Powered by blists - more mailing lists