Commit 30134b7
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: Jose Abreu <Jose.Abreu@synopsys.com>
Fixes: ba39b34 ("net: ethernet: stmicro: stmmac: generate stmmac dma conf before open")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: Jose Abreu <Jose.Abreu@synopsys.com>
Link: https://lore.kernel.org/r/20230614091714.15912-1-ansuelsmth@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 44194cb commit 30134b7
1 file changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3873 | 3873 | | |
3874 | 3874 | | |
3875 | 3875 | | |
3876 | | - | |
3877 | 3876 | | |
3878 | 3877 | | |
3879 | 3878 | | |
| |||
3891 | 3890 | | |
3892 | 3891 | | |
3893 | 3892 | | |
| 3893 | + | |
| 3894 | + | |
| 3895 | + | |
3894 | 3896 | | |
3895 | 3897 | | |
3896 | 3898 | | |
| |||
5633 | 5635 | | |
5634 | 5636 | | |
5635 | 5637 | | |
5636 | | - | |
5637 | 5638 | | |
| 5639 | + | |
| 5640 | + | |
5638 | 5641 | | |
5639 | 5642 | | |
5640 | 5643 | | |
5641 | 5644 | | |
| 5645 | + | |
| 5646 | + | |
5642 | 5647 | | |
5643 | 5648 | | |
5644 | 5649 | | |
| |||
0 commit comments