Skip to content

Commit

Permalink
autofs: fix a leak in autofs_expire_indirect()
Browse files Browse the repository at this point in the history
if the second call of should_expire() in there ends up
grabbing and returning a new reference to dentry, we need
to drop it before continuing.

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Oct 25, 2019
1 parent 97eba80 commit 03ad0d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/autofs/expire.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,10 @@ static struct dentry *autofs_expire_indirect(struct super_block *sb,
*/
how &= ~AUTOFS_EXP_LEAVES;
found = should_expire(expired, mnt, timeout, how);
if (!found || found != expired)
/* Something has changed, continue */
if (found != expired) { // something has changed, continue
dput(found);
goto next;
}

if (expired != dentry)
dput(dentry);
Expand Down

0 comments on commit 03ad0d7

Please sign in to comment.