@@ -810,10 +810,10 @@ static int svc_rdma_send_reply_msg(struct svcxprt_rdma *rdma,
810
810
*
811
811
* Remote Invalidation is skipped for simplicity.
812
812
*/
813
- static int svc_rdma_send_error_msg (struct svcxprt_rdma * rdma ,
814
- struct svc_rdma_send_ctxt * sctxt ,
815
- struct svc_rdma_recv_ctxt * rctxt ,
816
- int status )
813
+ static void svc_rdma_send_error_msg (struct svcxprt_rdma * rdma ,
814
+ struct svc_rdma_send_ctxt * sctxt ,
815
+ struct svc_rdma_recv_ctxt * rctxt ,
816
+ int status )
817
817
{
818
818
__be32 * rdma_argp = rctxt -> rc_recv_buf ;
819
819
__be32 * p ;
@@ -825,7 +825,7 @@ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma,
825
825
p = xdr_reserve_space (& sctxt -> sc_stream ,
826
826
rpcrdma_fixed_maxsz * sizeof (* p ));
827
827
if (!p )
828
- return - ENOMSG ;
828
+ goto put_ctxt ;
829
829
830
830
* p ++ = * rdma_argp ;
831
831
* p ++ = * (rdma_argp + 1 );
@@ -836,7 +836,7 @@ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma,
836
836
case - EPROTONOSUPPORT :
837
837
p = xdr_reserve_space (& sctxt -> sc_stream , 3 * sizeof (* p ));
838
838
if (!p )
839
- return - ENOMSG ;
839
+ goto put_ctxt ;
840
840
841
841
* p ++ = err_vers ;
842
842
* p ++ = rpcrdma_version ;
@@ -846,7 +846,7 @@ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma,
846
846
default :
847
847
p = xdr_reserve_space (& sctxt -> sc_stream , sizeof (* p ));
848
848
if (!p )
849
- return - ENOMSG ;
849
+ goto put_ctxt ;
850
850
851
851
* p = err_chunk ;
852
852
trace_svcrdma_err_chunk (* rdma_argp );
@@ -855,7 +855,12 @@ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma,
855
855
sctxt -> sc_send_wr .num_sge = 1 ;
856
856
sctxt -> sc_send_wr .opcode = IB_WR_SEND ;
857
857
sctxt -> sc_sges [0 ].length = sctxt -> sc_hdrbuf .len ;
858
- return svc_rdma_send (rdma , & sctxt -> sc_send_wr );
858
+ if (svc_rdma_send (rdma , & sctxt -> sc_send_wr ))
859
+ goto put_ctxt ;
860
+ return ;
861
+
862
+ put_ctxt :
863
+ svc_rdma_send_ctxt_put (rdma , sctxt );
859
864
}
860
865
861
866
/**
@@ -950,9 +955,7 @@ int svc_rdma_sendto(struct svc_rqst *rqstp)
950
955
* of previously posted RDMA Writes.
951
956
*/
952
957
svc_rdma_save_io_pages (rqstp , sctxt );
953
- ret = svc_rdma_send_error_msg (rdma , sctxt , rctxt , ret );
954
- if (ret < 0 )
955
- goto err1 ;
958
+ svc_rdma_send_error_msg (rdma , sctxt , rctxt , ret );
956
959
return 0 ;
957
960
958
961
err1 :
0 commit comments