[ewg] [PATCH] IB/sdp Fix a kernel panic in put_page() that was passing NULL

Ralph Campbell ralph.campbell at qlogic.com
Fri Nov 30 15:06:43 PST 2007


The new bzcopy_state() was trying to free unset bz->pages[i]
entries.

Signed-off-by: Dave Olson <dave.olson at qlogic.com>

diff --git a/drivers/infiniband/ulp/sdp/sdp_main.c b/drivers/infiniband/ulp/sdp/sdp_main.c
index 809f7b8..35c4dd3 100644
--- a/drivers/infiniband/ulp/sdp/sdp_main.c
+++ b/drivers/infiniband/ulp/sdp/sdp_main.c
@@ -1212,7 +1212,8 @@ 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++)
-			put_page(bz->pages[i]);
+			if (bz->pages[i])
+				put_page(bz->pages[i]);
 
 		kfree(bz->pages);
 	}





More information about the ewg mailing list