projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b5555f7
)
Btrfs: free inode struct when btrfs_new_inode fails
author
Shen Feng
<shen@cn.fujitsu.com>
Thu, 2 Apr 2009 20:46:06 +0000
(16:46 -0400)
committer
Chris Mason
<chris.mason@oracle.com>
Thu, 2 Apr 2009 20:46:06 +0000
(16:46 -0400)
btrfs_new_inode doesn't call iput to free the inode
when it fails.
Signed-off-by: Shen Feng <shen@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/inode.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/btrfs/inode.c
b/fs/btrfs/inode.c
index 1cff528d5b5198e2d41ccd6a8ba5df27f5db7a62..0ecb3fa75dc311b701c17472bf088795d80b6749 100644
(file)
--- a/
fs/btrfs/inode.c
+++ b/
fs/btrfs/inode.c
@@
-3481,8
+3481,10
@@
static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
if (dir) {
ret = btrfs_set_inode_index(dir, index);
- if (ret)
+ if (ret) {
+ iput(inode);
return ERR_PTR(ret);
+ }
}
/*
* index_cnt is ignored for everything but a dir,
@@
-3565,6
+3567,7
@@
fail:
if (dir)
BTRFS_I(dir)->index_cnt--;
btrfs_free_path(path);
+ iput(inode);
return ERR_PTR(ret);
}