diff options
author | Daniel Rosenberg <drosen@google.com> | 2017-05-22 13:23:56 -0700 |
---|---|---|
committer | Amit Pundir <amit.pundir@linaro.org> | 2017-07-17 10:27:40 +0530 |
commit | 43fd75e165d26839278ec0da76b7e3484784e68f (patch) | |
tree | 829e9f0435fa3001d759258c8110fa31103fcba7 | |
parent | 4462a1c4481eb41354f638fc3e4a31879dd9b083 (diff) | |
download | linaro-android-43fd75e165d26839278ec0da76b7e3484784e68f.tar.gz |
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
-rw-r--r-- | fs/sdcardfs/dentry.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/sdcardfs/dentry.c b/fs/sdcardfs/dentry.c index a23168179716..e9426a61d04a 100644 --- a/fs/sdcardfs/dentry.c +++ b/fs/sdcardfs/dentry.c @@ -109,14 +109,16 @@ static int sdcardfs_d_revalidate(struct dentry *dentry, unsigned int flags) goto out; /* If our top's inode is gone, we may be out of date */ - inode = d_inode(dentry); + inode = igrab(d_inode(dentry)); if (inode) { data = top_data_get(SDCARDFS_I(inode)); - if (data->abandoned) { + if (!data || data->abandoned) { d_drop(dentry); err = 0; } - data_put(data); + if (data) + data_put(data); + iput(inode); } out: |