Created attachment 240667 [details] Fix memory leak in micphy The micphy_attach() uses mii_fdt_get_config() to allocates memory for mii_fdt_phy_config_t *cfg. However, the allocated memory, mii_fdt_phy_config_t *cfg, is not freed before the micphy_attach() returns. (See vscphy_fdt_get_config() in vscphy.c for an example)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=9a622787244c4cda76d1509b0eae168bf4fd1952 commit 9a622787244c4cda76d1509b0eae168bf4fd1952 Author: Jiahao LI <jiahali@blackberry.com> AuthorDate: 2024-01-08 07:39:56 +0000 Commit: Yoshihiro Takahashi <nyan@FreeBSD.org> CommitDate: 2024-01-08 07:39:56 +0000 mii: Fix memory leak in micphy. PR: 270040 MFC after: 1 week sys/dev/mii/micphy.c | 2 ++ 1 file changed, 2 insertions(+)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=fbc5e31c4f1e97139aa718baafec096ead8139dd commit fbc5e31c4f1e97139aa718baafec096ead8139dd Author: Jiahao LI <jiahali@blackberry.com> AuthorDate: 2024-01-08 07:39:56 +0000 Commit: Yoshihiro Takahashi <nyan@FreeBSD.org> CommitDate: 2024-01-15 10:26:02 +0000 mii: Fix memory leak in micphy. PR: 270040 MFC after: 1 week (cherry picked from commit 9a622787244c4cda76d1509b0eae168bf4fd1952) sys/dev/mii/micphy.c | 2 ++ 1 file changed, 2 insertions(+)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=e31753a024758a1aa5db95950497c7f04e245b42 commit e31753a024758a1aa5db95950497c7f04e245b42 Author: Jiahao LI <jiahali@blackberry.com> AuthorDate: 2024-01-08 07:39:56 +0000 Commit: Yoshihiro Takahashi <nyan@FreeBSD.org> CommitDate: 2024-01-15 10:26:49 +0000 mii: Fix memory leak in micphy. PR: 270040 MFC after: 1 week (cherry picked from commit 9a622787244c4cda76d1509b0eae168bf4fd1952) sys/dev/mii/micphy.c | 2 ++ 1 file changed, 2 insertions(+)