[Bug 295684] mlx4ib: leak SRQ resources on mlx4_ib_create_srq() copyout failure

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 05 Oct 2026 19:11:44 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295684

Luis Castellanos <ing.castellanosdz@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ing.castellanosdz@gmail.com

--- Comment #1 from Luis Castellanos <ing.castellanosdz@gmail.com> ---
Reviewed the patch and verified on FreeBSD 14.5-RELEASE
(releng/14.5-n274872-4099b5c82880). Patch applies cleanly (Hunk #1 succeeded at
193).

Code review confirms the resource leak: mlx4_srq_alloc() succeeds at ~line 187,
but when ib_copy_to_udata() fails at ~line 196, the goto jumps to err_wrid
which frees DB/wrid but never calls mlx4_srq_free(). The fix introduces err_srq
label with mlx4_srq_free() before err_wrid, maintaining correct cleanup order.

The patch is correct and minimal. Submitted to Phabricator as D60356.

-- 
You are receiving this mail because:
You are the assignee for the bug.