hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/net/sunrpc/xprtrdma/verbs.c
....@@ -866,7 +866,7 @@
866866 return req;
867867
868868 out3:
869
- kfree(req->rl_sendbuf);
869
+ rpcrdma_regbuf_free(req->rl_sendbuf);
870870 out2:
871871 kfree(req);
872872 out1:
....@@ -972,9 +972,6 @@
972972 if (!rep->rr_rdmabuf)
973973 goto out_free;
974974
975
- if (!rpcrdma_regbuf_dma_map(r_xprt, rep->rr_rdmabuf))
976
- goto out_free_regbuf;
977
-
978975 xdr_buf_init(&rep->rr_hdrbuf, rdmab_data(rep->rr_rdmabuf),
979976 rdmab_length(rep->rr_rdmabuf));
980977 rep->rr_cqe.done = rpcrdma_wc_receive;
....@@ -987,8 +984,6 @@
987984 list_add(&rep->rr_all, &r_xprt->rx_buf.rb_all_reps);
988985 return rep;
989986
990
-out_free_regbuf:
991
- rpcrdma_regbuf_free(rep->rr_rdmabuf);
992987 out_free:
993988 kfree(rep);
994989 out:
....@@ -1425,6 +1420,10 @@
14251420 rep = rpcrdma_rep_create(r_xprt, temp);
14261421 if (!rep)
14271422 break;
1423
+ if (!rpcrdma_regbuf_dma_map(r_xprt, rep->rr_rdmabuf)) {
1424
+ rpcrdma_rep_put(buf, rep);
1425
+ break;
1426
+ }
14281427
14291428 trace_xprtrdma_post_recv(rep);
14301429 rep->rr_recv_wr.next = wr;