forked from Minki/linux
net: stmmac: Fix error handling path in 'alloc_dma_rx_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: 54139cf3bb
("net: stmmac: adding multiple buffers for rx")
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
fdf99b3ffc
commit
63c3aa6b68
@ -1498,7 +1498,7 @@ static int alloc_dma_rx_desc_resources(struct stmmac_priv *priv)
|
||||
sizeof(dma_addr_t),
|
||||
GFP_KERNEL);
|
||||
if (!rx_q->rx_skbuff_dma)
|
||||
return -ENOMEM;
|
||||
goto err_dma;
|
||||
|
||||
rx_q->rx_skbuff = kmalloc_array(DMA_RX_SIZE,
|
||||
sizeof(struct sk_buff *),
|
||||
|
Loading…
Reference in New Issue
Block a user