[ofw] PATCH: [mlx4] Fix error path on create qp.

Tzachi Dar tzachid at mellanox.co.il
Tue Mar 3 01:45:37 PST 2009


Applied on 2002.
 
Thanks
Tzachi


________________________________

	From: ofw-bounces at lists.openfabrics.org
[mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Tzachi Dar
	Sent: Monday, March 02, 2009 3:46 PM
	To: ofw at lists.openfabrics.org
	Subject: [ofw] PATCH: [mlx4] Fix error path on create qp.
	
	
	Index: Q:/projinf2/trunk/hw/mlx4/kernel/bus/ib/qp.c
	
===================================================================
	--- Q:/projinf2/trunk/hw/mlx4/kernel/bus/ib/qp.c (revision 4000)
	+++ Q:/projinf2/trunk/hw/mlx4/kernel/bus/ib/qp.c (revision 4001)
	@@ -326,6 +326,7 @@
	        struct ib_udata *udata, u32 sqpn, struct mlx4_ib_qp *qp)
	 {
	  int err;
	+ BOOLEAN range_allocated = 0;
	 
	  mutex_init(&qp->mutex);
	  spin_lock_init(&qp->sq.lock);
	@@ -429,20 +430,18 @@
	   }
	  }
	 
	- if (!sqpn)
	-  err = mlx4_qp_reserve_range(dev->dev, 1, 1, &sqpn);
	- if (err)
	-  goto err_wrid;
	+ if (!sqpn) {
	+   err = mlx4_qp_reserve_range(dev->dev, 1, 1, &sqpn);
	+  if (err)
	+   goto err_wrid;
	+  range_allocated = TRUE;
	+  
	+ }
	 
	  err = mlx4_qp_alloc(dev->dev, sqpn, &qp->mqp);
	  if (err)
	-  goto err_wrid;
	+  goto err_range;
	 
	- 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
	@@ -459,6 +458,10 @@
	 
	  return 0;
	 
	+err_range:
	+ if (range_allocated)
	+  mlx4_qp_release_range(dev->dev, sqpn, 1);
	+
	 err_wrid:
	  if (pd->p_uctx) {
	   if (!init_attr->srq)
	

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


More information about the ofw mailing list