Skip to contentSkip to conversation

srp: fix fmr error handling

PATCH New Michael S. Tsirkin 1 participant 2 messages Jul 10, 2006

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 srp: fix fmr error handling

Andrew, could you pls drop the following in -mm and on to Linus?

---

From: Vu Pham <[email protected]>

srp_unmap_data assumes req->fmr is NULL if the request is not mapped, so we must clean it out in case of an error.

drivers/infiniband/ulp/srp/ib_srp.c +0 -0
index 4e22afe..8f472e7 100644
@@ -615,9 +615,10 @@ static int srp_map_fmr(struct srp_device
 				(sg_dma_address(&scat[i]) & dev->fmr_page_mask) + j;
 
 	req->fmr = ib_fmr_pool_map_phys(dev->fmr_pool,
					dma_pages, page_cnt, &io_addr);

if (IS_ERR(req->fmr)) {
ret = PTR_ERR(req->fmr);
+ req->fmr = NULL;
goto out;
}

Signature · 6 lines
MST

----- End forwarded message -----

-- 
MST
#1 lore raw

PATCH 1/1 srp: fix fmr error handling

Sorry, the last patch I sent was corrupted, here's an updated version:

---

commit 7289361d5f81463e4abb27334773750279547e8a

Author: Vu Pham <[email protected]>
Date:   Mon Jul 10 22:38:14 2006 +0300

[PATCH] srp: fix fmr error handling

srp_unmap_data assumes req->fmr is NULL if the request is not mapped, so we must clean it out in case of an error.

drivers/infiniband/ulp/srp/ib_srp.c +1 -0
index 4e22afe..6191180 100644
@@ -618,6 +618,7 @@ static int srp_map_fmr(struct srp_device
 					dma_pages, page_cnt, &io_addr);
 	if (IS_ERR(req->fmr)) {
 		ret = PTR_ERR(req->fmr);
+		req->fmr = NULL;
 		goto out;
 	}
 
Signature · 1 line
MST