Skip to content

Commit e128c0f

Browse files
chucklevergregkh
authored andcommitted
svcrdma: Don't leak send_ctxt on Send errors
[ Upstream commit 351461f ] Address a rare send_ctxt leak in the svc_rdma_sendto() error paths. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent cf6b90e commit e128c0f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/sunrpc/xprtrdma/svc_rdma_sendto.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ int svc_rdma_sendto(struct svc_rqst *rqstp)
958958
p = xdr_reserve_space(&sctxt->sc_stream,
959959
rpcrdma_fixed_maxsz * sizeof(*p));
960960
if (!p)
961-
goto err0;
961+
goto err1;
962962

963963
ret = svc_rdma_send_reply_chunk(rdma, rctxt, &rqstp->rq_res);
964964
if (ret < 0)
@@ -970,11 +970,11 @@ int svc_rdma_sendto(struct svc_rqst *rqstp)
970970
*p = pcl_is_empty(&rctxt->rc_reply_pcl) ? rdma_msg : rdma_nomsg;
971971

972972
if (svc_rdma_encode_read_list(sctxt) < 0)
973-
goto err0;
973+
goto err1;
974974
if (svc_rdma_encode_write_list(rctxt, sctxt) < 0)
975-
goto err0;
975+
goto err1;
976976
if (svc_rdma_encode_reply_chunk(rctxt, sctxt, ret) < 0)
977-
goto err0;
977+
goto err1;
978978

979979
ret = svc_rdma_send_reply_msg(rdma, sctxt, rctxt, rqstp);
980980
if (ret < 0)

0 commit comments

Comments
 (0)