Skip to content

Commit 18d5c2f

Browse files
cyphargregkh
authored andcommitted
autofs: fix missing fput for FSCONFIG_SET_FD
[ Upstream commit 6a64c52 ] If you pass an fd using FSCONFIG_SET_FD, autofs_parse_fd() "steals" the param->file and so the fs_context infrastructure will not do fput() for us. Fixes: e6ec453 ("autofs: convert autofs to use the new mount api") Signed-off-by: Aleksa Sarai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 5fcf9e0 commit 18d5c2f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/autofs/inode.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,7 @@ static int autofs_parse_fd(struct fs_context *fc, struct autofs_sb_info *sbi,
172172
ret = autofs_check_pipe(pipe);
173173
if (ret < 0) {
174174
errorf(fc, "Invalid/unusable pipe");
175-
if (param->type != fs_value_is_file)
176-
fput(pipe);
175+
fput(pipe);
177176
return -EBADF;
178177
}
179178

0 commit comments

Comments
 (0)