diff options
author | Amir Goldstein <amir73il@gmail.com> | 2017-09-24 17:36:26 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-12 12:56:15 +0300 |
commit | a58388ca12212a818d80df1dddf8fca37c5552a7 (patch) | |
tree | a092dda43c7debe32c5814461874a941a3ca7d7d /fs | |
parent | 6aa5e931da9ab69b5df42ab2a2f9770b9215e6b3 (diff) | |
download | linux-a58388ca12212a818d80df1dddf8fca37c5552a7.tar.xz |
ovl: fix dput() of ERR_PTR in ovl_cleanup_index()
commit 9f4ec904dbd4eb1a2db10d5e7dc16eae386fe64d upstream.
Fixes: caf70cb2ba5d ("ovl: cleanup orphan index entries")
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/overlayfs/util.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index f46ad75dc96a..91f54ed25bd2 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -418,7 +418,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; @@ -457,6 +457,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; |