aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Roseberg <drosen@google.com>2017-05-09 13:36:35 -0700
committerDaniel Rosenberg <drosen@google.com>2017-05-09 16:26:04 -0700
commit03c66c0bb9776dd1c25292e1bc3790db31e7baec (patch)
treecb4c39b5bd33d88554c945b30721e6f27b12c0d3
parent5467ca32a6f301465d43272bee7c5a6fab5e0440 (diff)
ANDROID: sdcardfs: Don't iput if we didn't igrabandroid-o-preview-3_r0.2
If we fail to get top, top is either NULL, or igrab found that we're in the process of freeing that inode, and did not grab it. Either way, we didn't grab it, and have no business putting it. Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 38117720 Change-Id: Ie2f587483b9abb5144263156a443e89bc69b767b
-rwxr-xr-xfs/sdcardfs/inode.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/sdcardfs/inode.c b/fs/sdcardfs/inode.c
index 71694c0e9f14..05dcf0d5e08b 100755
--- a/fs/sdcardfs/inode.c
+++ b/fs/sdcardfs/inode.c
@@ -630,11 +630,8 @@ static int sdcardfs_permission(struct vfsmount *mnt, struct inode *inode, int ma
struct inode tmp;
struct inode *top = grab_top(SDCARDFS_I(inode));
- if (!top) {
- release_top(SDCARDFS_I(inode));
- WARN(1, "Top value was null!\n");
+ if (!top)
return -EINVAL;
- }
/*
* Permission check on sdcardfs inode.
@@ -708,10 +705,8 @@ static int sdcardfs_setattr(struct vfsmount *mnt, struct dentry *dentry, struct
inode = dentry->d_inode;
top = grab_top(SDCARDFS_I(inode));
- if (!top) {
- release_top(SDCARDFS_I(inode));
+ if (!top)
return -EINVAL;
- }
/*
* Permission check on sdcardfs inode.