[ofw][patch][MLX4] Fixed QP memory leak

Leonid Keller leonid at mellanox.co.il
Sun Nov 23 10:15:54 PST 2008


Fixed QP memory leak, inserted in 1288 fix.

The driver missed release of bits in QPN bitmap, preventing using this
qpn once more.

 
Index: hw/mlx4/kernel/bus/ib/qp.c
===================================================================
--- hw/mlx4/kernel/bus/ib/qp.c (revision 1765)
+++ hw/mlx4/kernel/bus/ib/qp.c (working copy)
@@ -438,6 +438,11 @@
  if (err)
   goto err_wrid;
 
+ if (err) {
+  mlx4_qp_release_range(dev->dev, sqpn, 1);
+  goto err_wrid;
+ }
+
  /*
   * Hardware wants QPN written in big-endian order (after
   * shifting) for send doorbell.  Precompute this value to save
@@ -551,6 +556,10 @@
  mlx4_ib_unlock_cqs(send_cq, recv_cq);
 
  mlx4_qp_free(dev->dev, &qp->mqp);
+
+ if (!is_sqp(dev, qp))
+  mlx4_qp_release_range(dev->dev, qp->mqp.qpn, 1);
+
  mlx4_mtt_cleanup(dev->dev, &qp->mtt);
 
  if (is_user) {

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


More information about the ofw mailing list