ANDROID: sdcardfs: Check for NULL in revalidate

If the inode is in the process of being evicted,
the top value may be NULL.

Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 38502532
Change-Id: I0b9d04aab621e0398d44d1c5dc53293106aa5f89
This commit is contained in:
Daniel Rosenberg 2017-05-22 13:23:56 -07:00 committed by Amit Pundir
parent aeea871de1
commit fba2029425

View file

@ -109,14 +109,16 @@ static int sdcardfs_d_revalidate(struct dentry *dentry, unsigned int flags)
goto out; goto out;
/* If our top's inode is gone, we may be out of date */ /* If our top's inode is gone, we may be out of date */
inode = d_inode(dentry); inode = igrab(d_inode(dentry));
if (inode) { if (inode) {
data = top_data_get(SDCARDFS_I(inode)); data = top_data_get(SDCARDFS_I(inode));
if (data->abandoned) { if (!data || data->abandoned) {
d_drop(dentry); d_drop(dentry);
err = 0; err = 0;
} }
data_put(data); if (data)
data_put(data);
iput(inode);
} }
out: out: