Skip to content

Commit 03ad0d7

Browse files
author
Al Viro
committed
autofs: fix a leak in autofs_expire_indirect()
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]>
1 parent 97eba80 commit 03ad0d7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/autofs/expire.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,10 @@ static struct dentry *autofs_expire_indirect(struct super_block *sb,
459459
*/
460460
how &= ~AUTOFS_EXP_LEAVES;
461461
found = should_expire(expired, mnt, timeout, how);
462-
if (!found || found != expired)
463-
/* Something has changed, continue */
462+
if (found != expired) { // something has changed, continue
463+
dput(found);
464464
goto next;
465+
}
465466

466467
if (expired != dentry)
467468
dput(dentry);

0 commit comments

Comments
 (0)