From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
<alexandre.torgue@st.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH 1/3] net: stmmac: Fix error handling path in 'alloc_dma_rx_desc_resources()'
Date: Mon, 10 Jul 2017 08:21:50 +0200 [thread overview]
Message-ID: <fce9a8f9-437b-2c14-a733-d8ec956f66c8@st.com> (raw)
In-Reply-To: <12c5a0a87b6ef1ae40e35e247703082a671f2934.1499499451.git.christophe.jaillet@wanadoo.fr>
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: 54139cf3bb33 ("net: stmmac: adding multiple buffers for rx")
> 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 19bba6281dab..4322fa4a13e8 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -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 *),
next prev parent reply other threads:[~2017-07-10 6:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-08 7:46 [PATCH 0/3] net: stmmac: Fixes and cleanups in 'alloc_dma_[rt]x_desc_resources()' Christophe JAILLET
2017-07-08 7:46 ` [PATCH 1/3] net: stmmac: Fix error handling path in 'alloc_dma_rx_desc_resources()' Christophe JAILLET
2017-07-10 6:21 ` Giuseppe CAVALLARO [this message]
2017-07-08 7:46 ` [PATCH 2/3] net: stmmac: Fix error handling path in 'alloc_dma_tx_desc_resources()' Christophe JAILLET
2017-07-10 6:22 ` Giuseppe CAVALLARO
2017-07-08 7:46 ` [PATCH 3/3] net: stmmac: Make 'alloc_dma_[rt]x_desc_resources()' look even closer Christophe JAILLET
2017-07-10 6:22 ` Giuseppe CAVALLARO
2017-07-11 20:34 ` [PATCH 0/3] net: stmmac: Fixes and cleanups in 'alloc_dma_[rt]x_desc_resources()' David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fce9a8f9-437b-2c14-a733-d8ec956f66c8@st.com \
--to=peppe.cavallaro@st.com \
--cc=alexandre.torgue@st.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).