]> git.baikalelectronics.ru Git - kernel.git/commit
net: stmmac: Fix error handling path in 'alloc_dma_rx_desc_resources()'
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>
Sat, 8 Jul 2017 07:46:33 +0000 (09:46 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 11 Jul 2017 20:33:53 +0000 (13:33 -0700)
commit685fb251f51e93be0b70ba46de75955289065e65
treec58722cb5897dbe9b3c4dd2b32599bf87bf85366
parentd49af4adcb4969442a21063159efebbe6efa407d
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: 2dcd3a7567e4 ("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>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c