Skip to content

Commit 3d7c075

Browse files
metze-sambagregkh
authored andcommitted
smb: client: fix smbdirect_recv_io leak in smbd_negotiate() error path
[ Upstream commit daac51c ] During tests of another unrelated patch I was able to trigger this error: Objects remaining on __kmem_cache_shutdown() Cc: Steve French <smfrench@gmail.com> Cc: Tom Talpey <tom@talpey.com> Cc: Long Li <longli@microsoft.com> Cc: Namjae Jeon <linkinjeon@kernel.org> Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Fixes: f198186 ("CIFS: SMBD: Establish SMB Direct connection") Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6241b9e commit 3d7c075

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/smb/client/smbdirect.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,8 +1084,10 @@ static int smbd_negotiate(struct smbd_connection *info)
10841084
log_rdma_event(INFO, "smbd_post_recv rc=%d iov.addr=0x%llx iov.length=%u iov.lkey=0x%x\n",
10851085
rc, response->sge.addr,
10861086
response->sge.length, response->sge.lkey);
1087-
if (rc)
1087+
if (rc) {
1088+
put_receive_buffer(info, response);
10881089
return rc;
1090+
}
10891091

10901092
init_completion(&info->negotiate_completion);
10911093
info->negotiate_done = false;

0 commit comments

Comments
 (0)