<!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><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></BODY></HTML>