From: Scott Feldman Date: Fri, 6 Mar 2015 23:54:52 +0000 (-0800) Subject: rocker: sparse: fix dynamic allocation on stack warning X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1b5ef07e3dd3972d9111650fb6e0f5a566c741d8;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git rocker: sparse: fix dynamic allocation on stack warning Signed-off-by: Scott Feldman Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c index 9629352fa5da..65e140315a58 100644 --- a/drivers/net/ethernet/rocker/rocker.c +++ b/drivers/net/ethernet/rocker/rocker.c @@ -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; diff --git a/drivers/net/ethernet/rocker/rocker.h b/drivers/net/ethernet/rocker/rocker.h index 0a94b7c300be..51e430d25138 100644 --- a/drivers/net/ethernet/rocker/rocker.h +++ b/drivers/net/ethernet/rocker/rocker.h @@ -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