Skip to content
Commit 30134b7c authored by Christian Marangi's avatar Christian Marangi Committed by Jakub Kicinski
Browse files

net: ethernet: stmicro: stmmac: fix possible memory leak in __stmmac_open



Fix a possible memory leak in __stmmac_open when stmmac_init_phy fails.
It's also needed to free everything allocated by stmmac_setup_dma_desc
and not just the dma_conf struct.

Drop free_dma_desc_resources from __stmmac_open and correctly call
free_dma_desc_resources on each user of __stmmac_open on error.

Reported-by: default avatarJose Abreu <Jose.Abreu@synopsys.com>
Fixes: ba39b344

 ("net: ethernet: stmicro: stmmac: generate stmmac dma conf before open")
Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Reviewed-by: default avatarJose Abreu <Jose.Abreu@synopsys.com>
Link: https://lore.kernel.org/r/20230614091714.15912-1-ansuelsmth@gmail.com
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 44194cb1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment