]> Pileus Git - ~andy/linux/blobdiff - drivers/infiniband/core/mad.c
Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git...
[~andy/linux] / drivers / infiniband / core / mad.c
index bb3dad20bb8371b5561285b5c716df0c442325e5..2fe428bba54ca947bee81df3f78f34f466c20dd8 100644 (file)
@@ -1597,6 +1597,9 @@ find_mad_agent(struct ib_mad_port_private *port_priv,
                                        mad->mad_hdr.class_version].class;
                        if (!class)
                                goto out;
+                       if (convert_mgmt_class(mad->mad_hdr.mgmt_class) >=
+                           IB_MGMT_MAX_METHODS)
+                               goto out;
                        method = class->method_table[convert_mgmt_class(
                                                        mad->mad_hdr.mgmt_class)];
                        if (method)