]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: mana: guard TX wq object destroy with INVALID_MANA_HANDLE check
authorAditya Garg <gargaditya@linux.microsoft.com>
Mon, 8 Jun 2026 10:13:41 +0000 (03:13 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 13 Jun 2026 00:26:05 +0000 (17:26 -0700)
mana_create_txq() has several error paths (after mana_alloc_queues() or
mana_create_wq_obj() failure) where tx_qp[i].tx_object stays as the
INVALID_MANA_HANDLE sentinel set at allocation. mana_destroy_txq() then
unconditionally calls mana_destroy_wq_obj() with (u64)-1, which firmware
rejects and logs an error.

Mirror the RX-side pattern in mana_destroy_rxq() and skip the destroy
when the handle is still INVALID_MANA_HANDLE.

Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
Signed-off-by: Aditya Garg <gargaditya@linux.microsoft.com>
Reviewed-by: Dipayaan Roy <dipayanroy@linux.microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://patch.msgid.link/20260608101345.2267320-3-gargaditya@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microsoft/mana/mana_en.c

index c9b1df1ed1098ca7fd63f6df17c18cc8a09d14cb..d7de4c4d25bbe51a37e37fa7dec1af7b6fa48854 100644 (file)
@@ -2334,7 +2334,8 @@ static void mana_destroy_txq(struct mana_port_context *apc)
                        netif_napi_del_locked(napi);
                        apc->tx_qp[i].txq.napi_initialized = false;
                }
-               mana_destroy_wq_obj(apc, GDMA_SQ, apc->tx_qp[i].tx_object);
+               if (apc->tx_qp[i].tx_object != INVALID_MANA_HANDLE)
+                       mana_destroy_wq_obj(apc, GDMA_SQ, apc->tx_qp[i].tx_object);
 
                mana_deinit_cq(apc, &apc->tx_qp[i].tx_cq);