From 8faefe19cd987462b9e760bb5e2f529905a4adfe Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Wed, 3 May 2023 01:35:46 -0700 Subject: [PATCH] modules/mqnic: Only allocate netdev queue resources for what is supported in HW Signed-off-by: Alex Forencich --- modules/mqnic/mqnic_netdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/mqnic/mqnic_netdev.c b/modules/mqnic/mqnic_netdev.c index 0d2771cd8..f5068b472 100644 --- a/modules/mqnic/mqnic_netdev.c +++ b/modules/mqnic/mqnic_netdev.c @@ -541,7 +541,8 @@ struct net_device *mqnic_create_netdev(struct mqnic_if *interface, int index, in int k; u32 desc_block_size; - ndev = alloc_etherdev_mqs(sizeof(*priv), MQNIC_MAX_TXQ, MQNIC_MAX_RXQ); + ndev = alloc_etherdev_mqs(sizeof(*priv), mqnic_res_get_count(interface->txq_res), + mqnic_res_get_count(interface->rxq_res)); if (!ndev) { dev_err(dev, "Failed to allocate memory"); return ERR_PTR(-ENOMEM);