A better fix of a potential memory leak in the new bzcopy code.

Signed-off-by: Dotan Barak <[EMAIL PROTECTED]>
---

Index: ofa_1_3_dev_kernel/drivers/infiniband/ulp/sdp/sdp_main.c
===================================================================
--- ofa_1_3_dev_kernel.orig/drivers/infiniband/ulp/sdp/sdp_main.c
2007-11-19 16:40:26.000000000 -0600
+++ ofa_1_3_dev_kernel/drivers/infiniband/ulp/sdp/sdp_main.c
2007-11-19 16:40:51.000000000 -0600
@@ -1238,10 +1238,6 @@
        if (!can_do_mlock())
                return NULL;
 
-       bz = kzalloc(sizeof(*bz), GFP_KERNEL);
-       if (!bz)
-               return NULL;
-
        /*
         *   Since we use the TCP segmentation fields of the skb to map
user
         * pages, we must make sure that everything we send in a single
chunk
@@ -1251,6 +1247,10 @@
        if (size_goal >= MAX_SKB_FRAGS)
                return NULL;
 
+       bz = kzalloc(sizeof(*bz), GFP_KERNEL);
+       if (!bz)
+               return NULL;
+
        addr = (unsigned long)base;
 
        bz->u_base     = base;
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to