[Bug 270270] mii: memory leak when mii_attach() fails

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 16 Mar 2023 14:45:10 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270270

            Bug ID: 270270
           Summary: mii: memory leak when mii_attach() fails
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: jiahali@blackberry.com

Created attachment 240901
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=240901&action=edit
Fix of memory leak when mii_attach() fails

When the PHY attach fails, the allocated miibus->softc from mii_attach() ->
device_set_driver() is not free. There is a memory leak for the "bus-sc"
memory.

A proposed fix is attached.

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