pandora: defconfig: update
[pandora-kernel.git] / drivers / infiniband / core / mad.c
index 0563892..78d406b 100644 (file)
@@ -35,6 +35,7 @@
  */
 #include <linux/dma-mapping.h>
 #include <linux/slab.h>
+#include <linux/module.h>
 #include <rdma/ib_cache.h>
 
 #include "mad_priv.h"
@@ -1597,7 +1598,7 @@ find_mad_agent(struct ib_mad_port_private *port_priv,
                        if (!class)
                                goto out;
                        if (convert_mgmt_class(mad->mad_hdr.mgmt_class) >=
-                           IB_MGMT_MAX_METHODS)
+                           ARRAY_SIZE(class->method_table))
                                goto out;
                        method = class->method_table[convert_mgmt_class(
                                                        mad->mad_hdr.mgmt_class)];