ovl: fix dput() of ERR_PTR in ovl_cleanup_index()
Fixes: caf70cb2ba
("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>
This commit is contained in:
parent
e0082a0f04
commit
9f4ec904db
|
@ -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)
|
static void ovl_cleanup_index(struct dentry *dentry)
|
||||||
{
|
{
|
||||||
struct inode *dir = ovl_indexdir(dentry->d_sb)->d_inode;
|
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);
|
err = PTR_ERR(index);
|
||||||
if (!IS_ERR(index))
|
if (!IS_ERR(index))
|
||||||
err = ovl_cleanup(dir, index);
|
err = ovl_cleanup(dir, index);
|
||||||
|
else
|
||||||
|
index = NULL;
|
||||||
|
|
||||||
inode_unlock(dir);
|
inode_unlock(dir);
|
||||||
if (err)
|
if (err)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
Loading…
Reference in New Issue