mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
util: netdev: Dynamically allocate 'struct nlattr' in virNetDevSwitchdevFeature
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>
This commit is contained in:
parent
9a3110862f
commit
89c7ff156b
@ -3210,7 +3210,7 @@ virNetDevSwitchdevFeature(const char *ifname,
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user