Page MenuHomeFreeBSD

mlx4ib: Fix SRQ resource leak on mlx4_ib_create_srq() copyout failure
Needs ReviewPublic

Authored by ing.castellanosdz_gmail.com on Mon, Oct 5, 3:58 AM.

Details

Reviewers
imp
Summary

In mlx4_ib_create_srq(), when ib_copy_to_udata() fails after
mlx4_srq_alloc() succeeds, the goto jumps to err_wrid which
frees DB/wrid but never calls mlx4_srq_free(), leaking the SRQ.

Introduce err_srq label with mlx4_srq_free() before err_wrid,
maintaining correct cleanup order.

Patch by Haoxiang Li.
Bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295684

Test Plan

Patch applies cleanly on FreeBSD 14.5-RELEASE (Hunk #1 at 193). Code review confirmed SRQ leak: mlx4_srq_alloc succeeds at ~line 187 but err_wrid does not free it.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline