devlink: don't allocate attrs on the stack
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 11 Feb 2019 03:35:28 +0000 (19:35 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Feb 2019 04:39:56 +0000 (20:39 -0800)
commit68750561dd5622307bbf0c77bc4f80e7b2dfce0c
tree8d5e852c21e53da684d04edc90a85b6876c5fda8
parent3ceb745baa4c90eb34dee983053fcbd2d8825a20
devlink: don't allocate attrs on the stack

Number of devlink attributes has grown over 128, causing the
following warning:

../net/core/devlink.c: In function ‘devlink_nl_cmd_region_read_dumpit’:
../net/core/devlink.c:3740:1: warning: the frame size of 1064 bytes is larger than 1024 bytes [-Wframe-larger-than=]
 }
  ^

Since the number of attributes is only going to grow allocate
the array dynamically.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/devlink.c