[openib-general] [PATCH] ib_mad: Only validate that receive completion handler is supplied if registration request supplied

Hal Rosenstock halr at voltaire.com
Wed Oct 13 09:49:35 PDT 2004


ib_mad: Only validate that receive completion handler is supplied if
registration request supplied in ib_register_mad_agent

Index: ib_mad.c
===================================================================
--- ib_mad.c    (revision 970)
+++ ib_mad.c    (working copy)
@@ -116,7 +116,7 @@
                goto error1;
        }
 
-       if (!send_handler || !recv_handler) {
+       if (!send_handler) {
                ret = ERR_PTR(-EINVAL);
                goto error1;
        }
@@ -128,7 +128,8 @@
 
        /* Validate MAD registration request if supplied */
        if (mad_reg_req) {
-               if (mad_reg_req->mgmt_class_version >= MAX_MGMT_VERSION)
{
+               if (!recv_handler ||
+                   mad_reg_req->mgmt_class_version >= MAX_MGMT_VERSION)
{
                        ret = ERR_PTR(-EINVAL);
                        goto error1;
                }





More information about the general mailing list