Page MenuHomeFreeBSD

ena: Fix leaking ifmedia resources on detach
AcceptedPublic

Authored by osamaabb_amazon.com on Aug 20 2024, 8:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 31, 8:22 PM
Unknown Object (File)
Wed, Oct 23, 5:10 PM
Unknown Object (File)
Sep 28 2024, 1:30 PM
Unknown Object (File)
Sep 27 2024, 1:00 AM
Unknown Object (File)
Sep 23 2024, 2:11 PM
Unknown Object (File)
Sep 23 2024, 2:10 PM
Unknown Object (File)
Sep 23 2024, 2:01 PM
Unknown Object (File)
Sep 20 2024, 2:04 AM
Subscribers

Details

Reviewers
cperciva
zlei
Summary

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().

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

Approved by: cperciva
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 59101
Build 55988: arc lint + arc unit

Event Timeline

zlei added a subscriber: zlei.

Do not forget ifmedia_removeall() for the label err_detach.

sys/dev/ena/ena.c
3981

Do not forget this.

This revision is now accepted and ready to land.Aug 21 2024, 2:41 AM
sys/dev/ena/ena.c
3981

@osamaabb_amazon.com You're going to add the ifmedia_removeall call here?

This revision now requires review to proceed.Sep 23 2024, 2:11 PM
sys/dev/ena/ena.c
3981

Nice catch, thanks!

3981

Addressed

This revision is now accepted and ready to land.Sep 24 2024, 5:10 AM
This revision now requires review to proceed.Oct 14 2024, 11:03 AM
This revision is now accepted and ready to land.Oct 14 2024, 1:05 PM