From: Amir Goldstein Date: Sun, 24 Sep 2017 14:36:26 +0000 (+0300) Subject: ovl: fix dput() of ERR_PTR in ovl_cleanup_index() X-Git-Tag: MMI-PSA29.97-13-9~4583^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9f4ec904dbd4eb1a2db10d5e7dc16eae386fe64d;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git ovl: fix dput() of ERR_PTR in ovl_cleanup_index() Fixes: caf70cb2ba5d ("ovl: cleanup orphan index entries") Cc: # v4.13 Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 117794582f9f..7ae33d225a67 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -430,7 +430,7 @@ void ovl_inuse_unlock(struct dentry *dentry) } } -/* Called must hold OVL_I(inode)->oi_lock */ +/* Caller must hold OVL_I(inode)->lock */ static void ovl_cleanup_index(struct dentry *dentry) { struct inode *dir = ovl_indexdir(dentry->d_sb)->d_inode; @@ -469,6 +469,9 @@ static void ovl_cleanup_index(struct dentry *dentry) err = PTR_ERR(index); if (!IS_ERR(index)) err = ovl_cleanup(dir, index); + else + index = NULL; + inode_unlock(dir); if (err) goto fail;