diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2009-01-26 15:00:58 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-02-02 08:28:06 -0800 |
commit | fa4da45cb75a9abc5356ca822368f405698b3d24 (patch) | |
tree | d54b092b34279cfbe4115cced93c397d30aae838 /fs | |
parent | 438095bc881d76bdfd2e6a2c7d1303622461f4b8 (diff) |
fuse: fix missing fput on error
commit 3ddf1e7f57237ac7c5d5bfb7058f1ea4f970b661 upstream.
Fix the leaking file reference if allocation or initialization of
fuse_conn failed.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fuse/inode.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 1806eabe28e..57342a624cb 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -832,12 +832,16 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent) if (!file) return -EINVAL; - if (file->f_op != &fuse_dev_operations) + if (file->f_op != &fuse_dev_operations) { + fput(file); return -EINVAL; + } fc = new_conn(sb); - if (!fc) + if (!fc) { + fput(file); return -ENOMEM; + } fc->flags = d.flags; fc->user_id = d.user_id; |