]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
fuse: fix missing fput on error
authorMiklos Szeredi <mszeredi@suse.cz>
Mon, 26 Jan 2009 14:00:58 +0000 (15:00 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Feb 2009 16:28:06 +0000 (08:28 -0800)
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>
fs/fuse/inode.c

index 1806eabe28e37c3048719ac73563cd24910c7c73..57342a624cb2965012708446e7a9412c5cf81a09 100644 (file)
@@ -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;