diff options
author | Amir Goldstein <amir73il@gmail.com> | 2017-09-24 10:36:26 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2017-10-05 09:53:18 -0400 |
commit | 9f4ec904dbd4eb1a2db10d5e7dc16eae386fe64d (patch) | |
tree | fc7f6a7103c2e6924b2f70be065719e38e00835a /fs/overlayfs/util.c | |
parent | e0082a0f04c432cb6d7128ef60d8e425e45ce025 (diff) |
ovl: fix dput() of ERR_PTR in ovl_cleanup_index()
Fixes: caf70cb2ba5d ("ovl: cleanup orphan index entries")
Cc: <stable@vger.kernel.org> # v4.13
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/util.c')
-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 117794582f9f..7ae33d225a67 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c | |||
@@ -430,7 +430,7 @@ void ovl_inuse_unlock(struct dentry *dentry) | |||
430 | } | 430 | } |
431 | } | 431 | } |
432 | 432 | ||
433 | /* Called must hold OVL_I(inode)->oi_lock */ | 433 | /* Caller must hold OVL_I(inode)->lock */ |
434 | static void ovl_cleanup_index(struct dentry *dentry) | 434 | static void ovl_cleanup_index(struct dentry *dentry) |
435 | { | 435 | { |
436 | struct inode *dir = ovl_indexdir(dentry->d_sb)->d_inode; | 436 | struct inode *dir = ovl_indexdir(dentry->d_sb)->d_inode; |
@@ -469,6 +469,9 @@ static void ovl_cleanup_index(struct dentry *dentry) | |||
469 | err = PTR_ERR(index); | 469 | err = PTR_ERR(index); |
470 | if (!IS_ERR(index)) | 470 | if (!IS_ERR(index)) |
471 | err = ovl_cleanup(dir, index); | 471 | err = ovl_cleanup(dir, index); |
472 | else | ||
473 | index = NULL; | ||
474 | |||
472 | inode_unlock(dir); | 475 | inode_unlock(dir); |
473 | if (err) | 476 | if (err) |
474 | goto fail; | 477 | goto fail; |