<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16587" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=433224509-03032009><FONT face=Arial color=#0000ff
size=2>Applied on 2002.</FONT></SPAN></DIV>
<DIV><SPAN class=433224509-03032009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=433224509-03032009><FONT face=Arial color=#0000ff
size=2>Thanks</FONT></SPAN></DIV>
<DIV><SPAN class=433224509-03032009><FONT face=Arial color=#0000ff
size=2>Tzachi</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> ofw-bounces@lists.openfabrics.org
[mailto:ofw-bounces@lists.openfabrics.org] <B>On Behalf Of </B>Tzachi
Dar<BR><B>Sent:</B> Monday, March 02, 2009 3:46 PM<BR><B>To:</B>
ofw@lists.openfabrics.org<BR><B>Subject:</B> [ofw] PATCH: [mlx4] Fix error
path on create qp.<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2>Index:
Q:/projinf2/trunk/hw/mlx4/kernel/bus/ib/qp.c<BR>===================================================================<BR>---
Q:/projinf2/trunk/hw/mlx4/kernel/bus/ib/qp.c (revision 4000)<BR>+++
Q:/projinf2/trunk/hw/mlx4/kernel/bus/ib/qp.c (revision 4001)<BR>@@ -326,6
+326,7 @@<BR> struct ib_udata
*udata, u32 sqpn, struct mlx4_ib_qp *qp)<BR> {<BR> int
err;<BR>+ BOOLEAN range_allocated =
0;<BR> <BR> mutex_init(&qp->mutex);<BR> spin_lock_init(&qp->sq.lock);<BR>@@
-429,20 +430,18
@@<BR> }<BR> }<BR> <BR>- if
(!sqpn)<BR>- err = mlx4_qp_reserve_range(dev->dev, 1, 1,
&sqpn);<BR>- if (err)<BR>- goto err_wrid;<BR>+ if
(!sqpn) {<BR>+ err = mlx4_qp_reserve_range(dev->dev, 1, 1,
&sqpn);<BR>+ if (err)<BR>+ goto
err_wrid;<BR>+ range_allocated =
TRUE;<BR>+ <BR>+ }<BR> <BR> err =
mlx4_qp_alloc(dev->dev, sqpn, &qp->mqp);<BR> if
(err)<BR>- goto err_wrid;<BR>+ goto
err_range;<BR> <BR>- if (err)
{<BR>- mlx4_qp_release_range(dev->dev, sqpn,
1);<BR>- goto
err_wrid;<BR>- }<BR>-<BR> /*<BR> * Hardware wants
QPN written in big-endian order (after<BR> * shifting) for send
doorbell. Precompute this value to save<BR>@@ -459,6 +458,10
@@<BR> <BR> return 0;<BR> <BR>+err_range:<BR>+ if
(range_allocated)<BR>+ mlx4_qp_release_range(dev->dev, sqpn,
1);<BR>+<BR> err_wrid:<BR> if (pd->p_uctx)
{<BR> if
(!init_attr->srq)<BR></FONT></DIV></BLOCKQUOTE></BODY></HTML>