diff options
| author | Daniel Rosenberg <drosen@google.com> | 2017-05-22 13:23:56 -0700 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-05-24 11:49:44 +0200 |
| commit | 1d6df6743980dbf160b7d8a74af73762f062a493 (patch) | |
| tree | e826924e546fa4e11e7dcfe6125fb81f3058aa4a | |
| parent | 74b355a6f1c79d82e399a769b68f98d12f773896 (diff) | |
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
| -rwxr-xr-x | 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 039c9530f..c8f3bcbfb 100755 --- 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 = dentry->d_inode; + inode = igrab(dentry->d_inode); 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: |
