[openib-general] [PATCH] ib_mad.c: Fix registration bugs

Hal Rosenstock halr at voltaire.com
Tue Sep 28 13:59:10 PDT 2004


Fix registration bugs

Registration and deregistration now appear to be working although this
has not been extensively tested.

Index: ib_mad.c
===================================================================
--- ib_mad.c    (revision 899)
+++ ib_mad.c    (working copy)
@@ -203,6 +203,7 @@
 
        /* Now, fill in the various structures */
        memset(mad_agent_priv, 0, sizeof *mad_agent_priv);
+       mad_agent_priv->port_priv = port_priv;
        mad_agent_priv->reg_req = reg_req;
        mad_agent_priv->rmpp_version = rmpp_version;
        mad_agent_priv->agent.device = device;
@@ -496,16 +497,16 @@
                return 0;
 
        private = priv->port_priv;
+       mgmt_class = convert_mgmt_class(mad_reg_req->mgmt_class);
        class = &private->version[mad_reg_req->mgmt_class_version];
-       mgmt_class = convert_mgmt_class(mad_reg_req->mgmt_class);
        if (!*class) {
-               /* Allocate management class table for "new" version */
+               /* Allocate management class table for "new" class
version */
                *class = kmalloc(sizeof **class, GFP_KERNEL);
                if (!*class) {
                        printk(KERN_ERR "No memory for
ib_mad_mgmt_class_table\n
");
                        goto error1;
                }
-               /* Clear management class table */
+               /* Clear management class table for this class version
*/
                for (i = 0; i < MAX_MGMT_CLASS; i++) {
                        (*class)->method_table[i] = NULL;
                }





More information about the general mailing list