rocker: sparse: fix dynamic allocation on stack warning
authorScott Feldman <sfeldma@gmail.com>
Fri, 6 Mar 2015 23:54:52 +0000 (15:54 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Mar 2015 03:01:27 +0000 (22:01 -0500)
Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/rocker/rocker.c
drivers/net/ethernet/rocker/rocker.h

index 9629352fa5daa2876613c62b60feddb5a0ad07a6..65e140315a58ec14411d51333a489e37588c0e31 100644 (file)
@@ -2955,7 +2955,7 @@ static int rocker_port_vlan_flood_group(struct rocker_port *rocker_port,
        struct rocker_port *p;
        struct rocker *rocker = rocker_port->rocker;
        u32 group_id = ROCKER_GROUP_L2_FLOOD(vlan_id, 0);
-       u32 group_ids[rocker->port_count];
+       u32 group_ids[ROCKER_FP_PORTS_MAX];
        u8 group_count = 0;
        int err;
        int i;
index 0a94b7c300bec629707934305450f4e9722bd283..51e430d251389d05936aef44f65306fe0c42366a 100644 (file)
@@ -27,6 +27,8 @@ enum {
        ROCKER_ENOBUFS = 105,
 };
 
+#define ROCKER_FP_PORTS_MAX 62
+
 #define PCI_VENDOR_ID_REDHAT           0x1b36
 #define PCI_DEVICE_ID_REDHAT_ROCKER    0x0006