[openib-general] svn checkin to merge upstream

Michael S. Tsirkin mst at mellanox.co.il
Sun Jul 23 02:29:33 PDT 2006


Quoting r. Sean Hefty <sean.hefty at intel.com>:
> Subject: svn checkin to merge upstream
> 
> Roland,
> 
> I committed a bug fix in svn rev 8629 to the IB CM that I'd like pushed upstream
> for 2.6.18.  It was possible for a function to return 0 (success) if an
> allocation occurred.
> 
> Thanks,
> - Sean


This one (below)?
Seems to do more than it says, and I now get a warning about the "out:" label
being unused. Is it just me?

Further, wouldn't
	if (IS_ERR()) {
		ret = PTR_ERR(cm_id_priv->timewait_info);
		goto out;
	}

be more elegant, and a smaller patch?

Finally, Sean, could you post patches inline on the list please?
It is confusing if the version in SVN differs from was last posted.

----

------------------------------------------------------------------------
r8629 | sean.hefty | 2006-07-22 00:19:38 +0300 (Sat, 22 Jul 2006) | 5 lines

Return error code, rather than success (0), on failure allocating timewait_info
in ib_send_cm_req.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>

------------------------------------------------------------------------
Index: xxx/drivers/infiniband/core/cm.c
===================================================================
--- xxx/drivers/infiniband/core/cm.c	(revision 8628)
+++ xxx/drivers/infiniband/core/cm.c	(revision 8629)
@@ -969,15 +969,14 @@ int ib_send_cm_req(struct ib_cm_id *cm_i
 	spin_lock_irqsave(&cm_id_priv->lock, flags);
 	if (cm_id->state != IB_CM_IDLE) {
 		spin_unlock_irqrestore(&cm_id_priv->lock, flags);
-		ret = -EINVAL;
-		goto out;
+		return -EINVAL;
 	}
 	spin_unlock_irqrestore(&cm_id_priv->lock, flags);
 
 	cm_id_priv->timewait_info = cm_create_timewait_info(cm_id_priv->
 							    id.local_id);
 	if (IS_ERR(cm_id_priv->timewait_info))
-		goto out;
+		return PTR_ERR(cm_id_priv->timewait_info);
 
 	ret = cm_init_av_by_path(param->primary_path, &cm_id_priv->av);
 	if (ret)

-- 
MST




More information about the general mailing list