mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 22:51:42 +00:00
net: stmmac: Fix error handling path in 'alloc_dma_tx_desc_resources()'
If the first 'kmalloc_array' within the loop fails, we should free what
as already been allocated, as done in all other error handling path.
Fixes: ce736788e8
("net: stmmac: adding multiple buffers for TX")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
63c3aa6b68
commit
6941f7cc71
@ -1561,7 +1561,7 @@ static int alloc_dma_tx_desc_resources(struct stmmac_priv *priv)
|
||||
sizeof(*tx_q->tx_skbuff_dma),
|
||||
GFP_KERNEL);
|
||||
if (!tx_q->tx_skbuff_dma)
|
||||
return -ENOMEM;
|
||||
goto err_dma_buffers;
|
||||
|
||||
tx_q->tx_skbuff = kmalloc_array(DMA_TX_SIZE,
|
||||
sizeof(struct sk_buff *),
|
||||
|
Loading…
Reference in New Issue
Block a user