drm/rockchip: dw-mipi: use phy_get_bus_width to fetch the lane_mbps for rk3368
[firefly-linux-kernel-4.4.55.git] / drivers / infiniband / core / mad.c
index 2281de122038e45a5c375f7d7669111ab2aee2de..8d84c563ba75351f053c223841c144e87afd80ec 100644 (file)
@@ -1745,7 +1745,7 @@ find_mad_agent(struct ib_mad_port_private *port_priv,
                        if (!class)
                                goto out;
                        if (convert_mgmt_class(mad_hdr->mgmt_class) >=
-                           IB_MGMT_MAX_METHODS)
+                           ARRAY_SIZE(class->method_table))
                                goto out;
                        method = class->method_table[convert_mgmt_class(
                                                        mad_hdr->mgmt_class)];