projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb875b3
)
fuse: fix missing fput on error
author
Miklos Szeredi
<
[email protected]
>
Mon, 26 Jan 2009 14:00:58 +0000
(15:00 +0100)
committer
Miklos Szeredi
<
[email protected]
>
Mon, 26 Jan 2009 14:00:58 +0000
(15:00 +0100)
Fix the leaking file reference if allocation or initialization of
fuse_conn failed.
Signed-off-by: Miklos Szeredi <
[email protected]
>
CC:
[email protected]
fs/fuse/inode.c
patch
|
blob
|
history
diff --git
a/fs/fuse/inode.c
b/fs/fuse/inode.c
index 47c96fdca1ac69afbf7f7eb841a9a50690754ee7..6893717b6536271459e89f7003d5c4c9dbe7bac2 100644
(file)
--- a/
fs/fuse/inode.c
+++ b/
fs/fuse/inode.c
@@
-829,15
+829,20
@@
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 = kmalloc(sizeof(*fc), GFP_KERNEL);
- if (!fc)
+ if (!fc) {
+ fput(file);
return -ENOMEM;
+ }
err = fuse_conn_init(fc, sb);
if (err) {
+ fput(file);
kfree(fc);
return err;
}