smb: client: fix smbdirect_recv_io leak in smbd_negotiate() error path

[ Upstream commit daac51c7032036a0ca5f1aa419ad1b0471d1c6e0 ]

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: f198186aa9 ("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>
This commit is contained in:
Stefan Metzmacher 2025-09-18 03:06:46 +02:00 committed by Greg Kroah-Hartman
parent 6241b9e280
commit 3d7c075c87

View File

@ -1084,8 +1084,10 @@ static int smbd_negotiate(struct smbd_connection *info)
log_rdma_event(INFO, "smbd_post_recv rc=%d iov.addr=0x%llx iov.length=%u iov.lkey=0x%x\n", log_rdma_event(INFO, "smbd_post_recv rc=%d iov.addr=0x%llx iov.length=%u iov.lkey=0x%x\n",
rc, response->sge.addr, rc, response->sge.addr,
response->sge.length, response->sge.lkey); response->sge.length, response->sge.lkey);
if (rc) if (rc) {
put_receive_buffer(info, response);
return rc; return rc;
}
init_completion(&info->negotiate_completion); init_completion(&info->negotiate_completion);
info->negotiate_done = false; info->negotiate_done = false;