]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: dwc_eth_qos: fix double resource leak in eqos_remove()
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Wed, 11 May 2022 14:12:50 +0000 (16:12 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 8 Aug 2022 14:50:20 +0000 (10:50 -0400)
Not only does eqos_remove() fail to free the buffers that have been
allocated by eqos_probe_resources_core(), it repeats those allocations
and thus drops twice as much memory on the floor.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
drivers/net/dwc_eth_qos.c

index c1f2391d6354064a6c8c9aaf30ef1c66b4f15b69..7c504dd1ca5e7949614db8d490c536e7da76437b 100644 (file)
@@ -1574,7 +1574,7 @@ static int eqos_remove(struct udevice *dev)
        eqos->config->ops->eqos_stop_clks(dev);
        eqos->config->ops->eqos_remove_resources(dev);
 
-       eqos_probe_resources_core(dev);
+       eqos_remove_resources_core(dev);
 
        debug("%s: OK\n", __func__);
        return 0;