<br><font size=2><tt>> Can you post patches in the body of your email
or at least with a mime<br>
type like text/plain or text/x-patch so I don't have to save the patch<br>
to look at it?</tt></font>
<br>
<br><font size=2 face="sans-serif">Ok, let's see whether this works? My
email has some problem for inline patch.</font>
<br>
<br>
<div>
<br><font size=2 face="sans-serif">diff -urN access/mad.c access.patch/mad.c<br>
--- access/mad.c 2004-10-29 14:17:18.000000000
-0700<br>
+++ access.patch/mad.c 2004-10-29 16:24:28.337157928
-0700<br>
@@ -221,7 +221,21 @@<br>
}<br>
/*
Make a copy of the MAD registration request */<br>
memcpy(reg_req,
mad_reg_req, sizeof *reg_req);<br>
- } <br>
+ }<br>
+ <br>
+ /* Now, fill in the various structures
*/<br>
+ memset(mad_agent_priv, 0, sizeof *mad_agent_priv);<br>
+ mad_agent_priv->port_priv = port_priv;<br>
+ mad_agent_priv->reg_req = reg_req;<br>
+ mad_agent_priv->rmpp_version =
rmpp_version;<br>
+ mad_agent_priv->agent.device =
device;<br>
+ mad_agent_priv->agent.recv_handler
= recv_handler;<br>
+ mad_agent_priv->agent.send_handler
= send_handler;<br>
+ mad_agent_priv->agent.context =
context;<br>
+ mad_agent_priv->agent.qp = port_priv->qp[qp_type];<br>
+ mad_agent_priv->agent.hi_tid =
++ib_mad_client_id;<br>
+ mad_agent_priv->agent.port_num
= port_num;<br>
+<br>
<br>
spin_lock_irqsave(&port_priv->reg_lock,
flags);<br>
<br>
@@ -237,31 +251,14 @@<br>
method = class->method_table[mgmt_class];<br>
if (method) {<br>
if (method_in_use(&method,
mad_reg_req)) {</font>
<br><font size=2 face="sans-serif">-
spin_unlock_irqrestore(<br>
-
&port_priv->reg_lock,
flags);<br>
ret = ERR_PTR(-EINVAL);<br>
goto error3;<br>
}<br>
}<br>
}<br>
}<br>
-<br>
- /* Now, fill in the various structures
*/<br>
- memset(mad_agent_priv, 0, sizeof *mad_agent_priv);<br>
- mad_agent_priv->port_priv = port_priv;<br>
- mad_agent_priv->reg_req = reg_req;<br>
- mad_agent_priv->rmpp_version =
rmpp_version;<br>
- mad_agent_priv->agent.device =
device;<br>
- mad_agent_priv->agent.recv_handler
= recv_handler;<br>
- mad_agent_priv->agent.send_handler
= send_handler;<br>
- mad_agent_priv->agent.context =
context;<br>
- mad_agent_priv->agent.qp = port_priv->qp[qp_type];<br>
- mad_agent_priv->agent.hi_tid =
++ib_mad_client_id;<br>
- mad_agent_priv->agent.port_num
= port_num;<br>
-<br>
ret2 = add_mad_reg_req(mad_reg_req,
mad_agent_priv);<br>
if (ret2) {<br>
- spin_unlock_irqrestore(&port_priv->reg_lock,
flags);<br>
ret
= ERR_PTR(ret2); <br>
goto
error3; <br>
}<br>
@@ -281,8 +278,8 @@<br>
return &mad_agent_priv->agent;<br>
<br>
error3:<br>
- if (reg_req)<br>
- kfree(reg_req);<br>
+ spin_unlock_irqrestore(&port_priv->reg_lock,
flags);</font>
<br><font size=2 face="sans-serif">+ kfree(reg_req);<br>
error2:<br>
kfree(mad_agent_priv);<br>
error1:</font>
<br><font size=2 face="sans-serif"><br>
</font>
<br><font size=2 face="sans-serif">thanks<br>
Shirley Ma<br>
IBM Linux Technology Center<br>
15300 SW Koll Parkway<br>
Beaverton, OR 97006-6063<br>
Phone: (503) 578-7638<br>
FAX: (503) 578-3228<br>
<br>
</font></div>