Skip to content

Commit daac51c

Browse files
metze-sambasmfrench
authored andcommitted
smb: client: fix smbdirect_recv_io leak in smbd_negotiate() error path
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>
1 parent 251090e commit daac51c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

fs/smb/client/smbdirect.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,8 +1108,10 @@ static int smbd_negotiate(struct smbd_connection *info)
11081108
log_rdma_event(INFO, "smbd_post_recv rc=%d iov.addr=0x%llx iov.length=%u iov.lkey=0x%x\n",
11091109
rc, response->sge.addr,
11101110
response->sge.length, response->sge.lkey);
1111-
if (rc)
1111+
if (rc) {
1112+
put_receive_buffer(info, response);
11121113
return rc;
1114+
}
11131115

11141116
init_completion(&info->negotiate_completion);
11151117
info->negotiate_done = false;

0 commit comments

Comments
 (0)