Skip to content

Commit

Permalink
ovl: fix dput() of ERR_PTR in ovl_cleanup_index()
Browse files Browse the repository at this point in the history
Fixes: caf70cb ("ovl: cleanup orphan index entries")
Cc: <[email protected]> # v4.13
Signed-off-by: Amir Goldstein <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
  • Loading branch information
amir73il authored and Miklos Szeredi committed Oct 5, 2017
1 parent e0082a0 commit 9f4ec90
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/overlayfs/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9f4ec90

Please sign in to comment.