[ofa-general] [PATCH] sdp: Fix memory leak in bzcopy

Amir Vadai amirv at mellanox.co.il
Wed Jul 1 09:45:00 PDT 2009


Thanks to Lars Ellenberg for finding the leak

Signed-off-by: Amir Vadai <amirv at mellanox.co.il>
---
 drivers/infiniband/ulp/sdp/sdp_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/ulp/sdp/sdp_main.c b/drivers/infiniband/ulp/sdp/sdp_main.c
index f238a0f..862878c 100644
--- a/drivers/infiniband/ulp/sdp/sdp_main.c
+++ b/drivers/infiniband/ulp/sdp/sdp_main.c
@@ -1294,7 +1294,7 @@ static inline struct bzcopy_state *sdp_bz_cleanup(struct bzcopy_state *bz)
 	}
 
 	if (bz->pages) {
-		for (i = bz->cur_page; i < bz->page_cnt; i++)
+		for (i = 0; i < bz->cur_page; i++)
 			put_page(bz->pages[i]);
 
 		kfree(bz->pages);
-- 
1.5.3.7




More information about the general mailing list