[ewg] [PATCH] IB/sdp - Fix NULL pointer oops when calling put_page()
Ralph Campbell
ralph.campbell at qlogic.com
Thu Jan 3 11:01:12 PST 2008
put_page() does not check for NULL pointers so SDP should check this
before calling it.
Note that this probably has spaces instead of tabs but I'm using
a web email interface and I'm not sure how to preserve tabs.
I assume the current SDP owner will apply this.
Signed-off-by: Ralph Campbell <ralph.campbell 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 b
zcopy_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);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ewg/attachments/20080103/b7b3e17b/attachment.html>
More information about the ewg
mailing list