diff options
| author | 2026-04-29 20:57:54 -0700 | |
|---|---|---|
| committer | 2026-05-05 12:16:23 +0200 | |
| commit | 3985c9a56da49af8b2e45cb1fa55c03c89b1d471 (patch) | |
| tree | 7a625f23b27038bbd3a069adb7aacdd8ddf1d80e /samples/kobject/ssh:/git@git.zx2c4.com/git:/git.zx2c4.com | |
| parent | net: mana: Skip WQ object destruction for uninitialized RXQ (diff) | |
net: mana: remove double CQ cleanup in mana_create_rxq error path
In mana_create_rxq(), the error cleanup path calls mana_destroy_rxq()
followed by mana_deinit_cq(). This is incorrect for two reasons:
1. mana_destroy_rxq() already calls mana_deinit_cq() internally,
so the CQ's GDMA queue is destroyed twice.
2. mana_destroy_rxq() frees the rxq via kfree(rxq) before returning.
The subsequent mana_deinit_cq(apc, cq) then operates on freed memory
since cq points to &rxq->rx_cq, which is embedded in the
already-freed rxq structure — a use-after-free.
Remove the redundant mana_deinit_cq() call from the error path since
mana_destroy_rxq() already handles CQ cleanup. mana_deinit_cq() is
itself safe for an uninitialized CQ as it checks for a NULL gdma_cq
before proceeding.
Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Dipayaan Roy <dipayanroy@linux.microsoft.com>
Reviewed-by: Aditya Garg <gargaditya@linux.microsoft.com>
Link: https://patch.msgid.link/20260430035935.1859220-4-dipayanroy@linux.microsoft.com
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'samples/kobject/ssh:/git@git.zx2c4.com/git:/git.zx2c4.com')
0 files changed, 0 insertions, 0 deletions
