Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1683554 > unrolled thread
| Started by | Christophe JAILLET <christophe.jaillet@wanadoo.fr> |
|---|---|
| First post | 2017-07-08 10:10 +0200 |
| Last post | 2017-07-10 08:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 2/3] net: stmmac: Fix error handling path in 'alloc_dma_tx_desc_resources()' Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-07-08 10:10 +0200
Re: [PATCH 2/3] net: stmmac: Fix error handling path in 'alloc_dma_tx_desc_resources()' Giuseppe CAVALLARO <peppe.cavallaro@st.com> - 2017-07-10 08:30 +0200
| From | Christophe JAILLET <christophe.jaillet@wanadoo.fr> |
|---|---|
| Date | 2017-07-08 10:10 +0200 |
| Subject | [PATCH 2/3] net: stmmac: Fix error handling path in 'alloc_dma_tx_desc_resources()' |
| Message-ID | <u0SYp-88v-3@gated-at.bofh.it> |
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: ce736788e8a9 ("net: stmmac: adding multiple buffers for TX")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 4322fa4a13e8..07d486a70118 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -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 *),
--
2.11.0
[toc] | [next] | [standalone]
| From | Giuseppe CAVALLARO <peppe.cavallaro@st.com> |
|---|---|
| Date | 2017-07-10 08:30 +0200 |
| Subject | Re: [PATCH 2/3] net: stmmac: Fix error handling path in 'alloc_dma_tx_desc_resources()' |
| Message-ID | <u1AmJ-1oe-7@gated-at.bofh.it> |
| In reply to | #1683554 |
On 7/8/2017 9:46 AM, Christophe JAILLET wrote:
> 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: ce736788e8a9 ("net: stmmac: adding multiple buffers for TX")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 4322fa4a13e8..07d486a70118 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -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 *),
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web