[ofw][patch][ibal] fix memory leak on power down/power up flow

Leonid Keller leonid at mellanox.co.il
Sat Apr 25 12:07:03 PDT 2009


port_mgr_port_add() allocates a port_pnp_ctx_t context, which is saved
by IBAL to be used later in port_mgr_port_remove().
But in hibernation flow port_mgr_port_remove() doesn't release this
context which causes IBBUS memory leak.
It was trapped by Verifier during WHQL Common Scenario Stress test.
 
The below patch fixes that.
 
 
Index: core/bus/kernel/bus_port_mgr.c
===================================================================
--- core/bus/kernel/bus_port_mgr.c (revision 2132)
+++ core/bus/kernel/bus_port_mgr.c (working copy)
@@ -1269,11 +1268,11 @@
  IoInvalidateDeviceRelations(
   p_ext->h_ca->p_hca_dev, BusRelations );
 
+hca_deref:
  /* Free PNP context memory */
  cl_free( p_ctx );
  p_pnp_rec->pnp_rec.context = NULL;
 
-hca_deref:
  deref_al_obj( &p_ext->h_ca->obj );
  
  // Setting h_ca to be NULL forces IPoIB to start only after
re-acquiring new CA object

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090425/1e5d91ae/attachment.html>


More information about the ofw mailing list