Page MenuHomeFreeBSD

mlx4ib: Fix EQ resource leak on mlx4_ib_add() error path
Needs ReviewPublic

Authored by ing.castellanosdz_gmail.com on Mon, Oct 5, 3:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 7, 2:45 PM
Unknown Object (File)
Wed, Oct 7, 12:01 AM
Unknown Object (File)
Tue, Oct 6, 11:25 PM
Subscribers
This revision needs review, but all specified reviewers are disabled or inactive.

Details

Reviewers
• hselasky
Summary

In mlx4_ib_add(), the normal teardown path calls mlx4_ib_free_eqs()
but the err_map error path jumps directly to iounmap() without freeing
EQs, leaking the resource.

Add mlx4_ib_free_eqs() call before iounmap in the error path, matching
the cleanup order of the normal teardown.

Patch by Haoxiang Li.
Bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295637
Verified: patch applies cleanly on 14.5-RELEASE

Test Plan

Patch applies cleanly on FreeBSD 14.5-RELEASE (Hunk #1 at 2773). Code review confirmed leak by comparing error path (line 2747) vs normal teardown (line 2856).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped