Skip to content

Commit f416c55

Browse files
ZhangGuoDongsmfrench
authored andcommitted
smb/server: fix refcount leak in smb2_open()
When ksmbd_vfs_getattr() fails, the reference count of ksmbd_file must be released. Suggested-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 3296c30 commit f416c55

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/smb/server/smb2pdu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3010,10 +3010,10 @@ int smb2_open(struct ksmbd_work *work)
30103010
file_info = FILE_OPENED;
30113011

30123012
rc = ksmbd_vfs_getattr(&fp->filp->f_path, &stat);
3013+
ksmbd_put_durable_fd(fp);
30133014
if (rc)
30143015
goto err_out2;
30153016

3016-
ksmbd_put_durable_fd(fp);
30173017
goto reconnected_fp;
30183018
}
30193019
} else if (req_op_level == SMB2_OPLOCK_LEVEL_LEASE)

0 commit comments

Comments
 (0)