]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: mtk_eth_soc: fix device leak at probe
authorJohan Hovold <johan@kernel.org>
Fri, 25 Jul 2025 17:12:12 +0000 (19:12 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 31 Jul 2025 01:02:48 +0000 (18:02 -0700)
The reference count to the WED devices has already been incremented when
looking them up using of_find_device_by_node() so drop the bogus
additional reference taken during probe.

Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
Cc: stable@vger.kernel.org # 5.19
Cc: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250725171213.880-5-johan@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mediatek/mtk_wed.c

index 73c26fcfd85e7be3040abea8e80ff4bee881016c..0a80d8f8cff7f415a60b0cd68c0c9c07e2c88f36 100644 (file)
@@ -2782,7 +2782,6 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
        if (!pdev)
                goto err_of_node_put;
 
-       get_device(&pdev->dev);
        irq = platform_get_irq(pdev, 0);
        if (irq < 0)
                goto err_put_device;