HomeFreeBSD

ena: Fix leaking ifmedia resources on detach

Description

ena: Fix leaking ifmedia resources on detach

ifmedia_add() allocates an ifmedia_entry during ena_attach.
Current code doesn't release this memory during ena_detach()

This commit calls ifmedia_removeall() to properly free the
allocated memory during ena_detach().

Also, in case ena_attach fails, we need to detach ifmedia
which was allocated within ena_setup_ifnet().

This bug was first described in:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278100

Reviewed by: zlei
Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

Details

Provenance
osamaabb_amazon.comAuthored on Aug 7 2024, 6:24 AM
Parents
rGd0419551d96c: ena: Support max large LLQ depth from the device
Branches
Unknown
Tags
Unknown