<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.59">
<TITLE>[PATCH] IB/sdp - Fix NULL pointer oops when calling put_page()</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>put_page() does not check for NULL pointers so SDP should check this<BR>
before calling it.<BR>
<BR>
Note that this probably has spaces instead of tabs but I'm using<BR>
a web email interface and I'm not sure how to preserve tabs.<BR>
I assume the current SDP owner will apply this.<BR>
<BR>
Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com><BR>
<BR>
diff --git a/drivers/infiniband/ulp/sdp/sdp_main.c b/drivers/infiniband/ulp/sdp/<BR>
sdp_main.c<BR>
index 809f7b8..35c4dd3 100644<BR>
--- a/drivers/infiniband/ulp/sdp/sdp_main.c<BR>
+++ b/drivers/infiniband/ulp/sdp/sdp_main.c<BR>
@@ -1212,7 +1212,8 @@ static inline struct bzcopy_state *sdp_bz_cleanup(struct b<BR>
zcopy_state *bz)<BR>
<BR>
        if (bz->pages) {<BR>
                for (i = bz->cur_page; i < bz->page_cnt; i++)<BR>
-                       put_page(bz->pages[i]);<BR>
+                       if (bz->pages[i])<BR>
+                               put_page(bz->pages[i]);<BR>
<BR>
                kfree(bz->pages);<BR>
        }<BR>
</FONT>
</P>

</BODY>
</HTML>