Allocate enough pointers for all possible ports, to avoid problems in
cleanup/unload.

Signed-off-by: Bryan O'Sullivan <[EMAIL PROTECTED]>

diff --git a/drivers/infiniband/hw/ipath/ipath_init_chip.c 
b/drivers/infiniband/hw/ipath/ipath_init_chip.c
--- a/drivers/infiniband/hw/ipath/ipath_init_chip.c     Fri Aug 25 11:19:44 
2006 -0700
+++ b/drivers/infiniband/hw/ipath/ipath_init_chip.c     Fri Aug 25 11:19:44 
2006 -0700
@@ -240,7 +240,11 @@ static int init_chip_first(struct ipath_
                          "only supports %u\n", ipath_cfgports,
                          dd->ipath_portcnt);
        }
-       dd->ipath_pd = kzalloc(sizeof(*dd->ipath_pd) * dd->ipath_cfgports,
+       /*
+        * Allocate full portcnt array, rather than just cfgports, because
+        * cleanup iterates across all possible ports.
+        */
+       dd->ipath_pd = kzalloc(sizeof(*dd->ipath_pd) * dd->ipath_portcnt,
                               GFP_KERNEL);
 
        if (!dd->ipath_pd) {

_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

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

Reply via email to