At time of writing DEVLINK_ATTR_MAX equals to 176, thus the stack'd size
of the pointer array is almost 1.4kiB. Allocate it dynamically.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
struct nl_msg *nl_msg = NULL;
g_autofree struct nlmsghdr *resp = NULL;
unsigned int recvbuflen;
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {NULL, };
+ g_autofree struct nlattr **tb = g_new0(struct nlattr *, DEVLINK_ATTR_MAX + 1);
g_autoptr(virPCIDevice) pci_device_ptr = NULL;
struct genlmsghdr gmsgh = {
.cmd = DEVLINK_CMD_ESWITCH_GET,