netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 9p/rdma: unmap receive dma buffer in rdma_request()
@ 2022-12-20  3:12 Zhengchao Shao
  2022-12-28  9:35 ` Leon Romanovsky
  0 siblings, 1 reply; 3+ messages in thread
From: Zhengchao Shao @ 2022-12-20  3:12 UTC (permalink / raw)
  To: v9fs-developer, netdev, ericvh, lucho, asmadeus, davem, edumazet,
	kuba, pabeni
  Cc: linux_oss, tom, weiyongjun1, yuehaibing, shaozhengchao

When down_interruptible() failed in rdma_request(), receive dma buffer
is not unmapped. Add unmap action to error path.

Fixes: fc79d4b104f0 ("9p: rdma: RDMA Transport Support for 9P")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
 net/9p/trans_rdma.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c
index 83f9100d46bf..da83023fecbf 100644
--- a/net/9p/trans_rdma.c
+++ b/net/9p/trans_rdma.c
@@ -499,6 +499,8 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req)
 
 	if (down_interruptible(&rdma->sq_sem)) {
 		err = -EINTR;
+		ib_dma_unmap_single(rdma->cm_id->device, c->busa,
+				    c->req->tc.size, DMA_TO_DEVICE);
 		goto send_error;
 	}
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-04  1:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-20  3:12 [PATCH] 9p/rdma: unmap receive dma buffer in rdma_request() Zhengchao Shao
2022-12-28  9:35 ` Leon Romanovsky
2023-01-04  1:30   ` shaozhengchao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).