Re: [PATCH] net: hisilicon: hns_dsaf_mac: fix mdio device leak in hns_mac_register_phy()

From: Simon Horman

Date: Mon Sep 21 2026 - 06:36:43 EST


On Thu, Sep 17, 2026 at 11:08:28AM +0000, Wentao Liang wrote:
> hns_dsaf_find_platform_device() returns the mdio platform device with its
> reference count incremented. hns_mac_register_phy() never drops that
> reference, so the mdio device can not be released.
>
> Release the reference on both the deferred probe and the normal path.
>
> Fixes: 1d1afa2ebf82 ("net: hns: register phy device in each mac initial sequence")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>