summaryrefslogtreecommitdiff
path: root/fs/sdcardfs
diff options
context:
space:
mode:
authorDaniel Rosenberg <drosen@google.com>2017-06-07 12:44:50 -0700
committerAmit Pundir <amit.pundir@linaro.org>2017-06-21 16:39:30 +0530
commit71efbfbf131d77d61c61ee1766d80d5ff68a72bf (patch)
tree3145d48cf8dbbea2bcf02849b1c0d2f42712fabd /fs/sdcardfs
parent36a6c648e2dfeb9d1cd16069b33ed2c2c42db63e (diff)
ANDROID: sdcardfs: d_splice_alias can return error values
We must check that d_splice_alias was successful before using its output. Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 62390017 Change-Id: Ifda0a052fb3f67e35c635a4e5e907876c5400978
Diffstat (limited to 'fs/sdcardfs')
-rw-r--r--fs/sdcardfs/lookup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/sdcardfs/lookup.c b/fs/sdcardfs/lookup.c
index 00ae21151f52..676e394e07be 100644
--- a/fs/sdcardfs/lookup.c
+++ b/fs/sdcardfs/lookup.c
@@ -199,7 +199,8 @@ static struct dentry *__sdcardfs_interpose(struct dentry *dentry,
ret_dentry = d_splice_alias(inode, dentry);
dentry = ret_dentry ?: dentry;
- update_derived_permission_lock(dentry);
+ if (!IS_ERR(dentry))
+ update_derived_permission_lock(dentry);
out:
return ret_dentry;
}