Skip to content
Snippets Groups Projects
Commit 03c66c0b authored by Daniel Roseberg's avatar Daniel Roseberg Committed by Daniel Rosenberg
Browse files

ANDROID: sdcardfs: Don't iput if we didn't igrab


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: default avatarDaniel Rosenberg <drosen@google.com>
Bug: 38117720
Change-Id: Ie2f587483b9abb5144263156a443e89bc69b767b
parent 5467ca32
Branches android-msm-bullhead-3.10-o-preview-3
Tags android-o-preview-3_r0.2
No related merge requests found
...@@ -630,11 +630,8 @@ static int sdcardfs_permission(struct vfsmount *mnt, struct inode *inode, int ma ...@@ -630,11 +630,8 @@ static int sdcardfs_permission(struct vfsmount *mnt, struct inode *inode, int ma
struct inode tmp; struct inode tmp;
struct inode *top = grab_top(SDCARDFS_I(inode)); struct inode *top = grab_top(SDCARDFS_I(inode));
if (!top) { if (!top)
release_top(SDCARDFS_I(inode));
WARN(1, "Top value was null!\n");
return -EINVAL; return -EINVAL;
}
/* /*
* Permission check on sdcardfs inode. * Permission check on sdcardfs inode.
...@@ -708,10 +705,8 @@ static int sdcardfs_setattr(struct vfsmount *mnt, struct dentry *dentry, struct ...@@ -708,10 +705,8 @@ static int sdcardfs_setattr(struct vfsmount *mnt, struct dentry *dentry, struct
inode = dentry->d_inode; inode = dentry->d_inode;
top = grab_top(SDCARDFS_I(inode)); top = grab_top(SDCARDFS_I(inode));
if (!top) { if (!top)
release_top(SDCARDFS_I(inode));
return -EINVAL; return -EINVAL;
}
/* /*
* Permission check on sdcardfs inode. * Permission check on sdcardfs inode.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment