All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: stmmac: Check return value of alloc_dma_desc_resources()
@ 2014-02-22 12:09 Tobias Klauser
  2014-02-24 15:22 ` Giuseppe CAVALLARO
  2014-02-24 23:58 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Tobias Klauser @ 2014-02-22 12:09 UTC (permalink / raw)
  To: Giuseppe Cavallaro; +Cc: netdev

alloc_dma_desc_resources() returns an error value and the next line
actually checks for it, so assign the return value properly.

Found by the coverity scanner.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 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 a2e7d2c..078ad0e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1705,7 +1705,7 @@ static int stmmac_open(struct net_device *dev)
 	priv->dma_rx_size = STMMAC_ALIGN(dma_rxsize);
 	priv->dma_buf_sz = STMMAC_ALIGN(buf_sz);
 
-	alloc_dma_desc_resources(priv);
+	ret = alloc_dma_desc_resources(priv);
 	if (ret < 0) {
 		pr_err("%s: DMA descriptors allocation failed\n", __func__);
 		goto dma_desc_error;
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: stmmac: Check return value of alloc_dma_desc_resources()
  2014-02-22 12:09 [PATCH] net: stmmac: Check return value of alloc_dma_desc_resources() Tobias Klauser
@ 2014-02-24 15:22 ` Giuseppe CAVALLARO
  2014-02-24 23:58 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Giuseppe CAVALLARO @ 2014-02-24 15:22 UTC (permalink / raw)
  To: Tobias Klauser; +Cc: netdev

On 2/22/2014 1:09 PM, Tobias Klauser wrote:
> alloc_dma_desc_resources() returns an error value and the next line
> actually checks for it, so assign the return value properly.
>
> Found by the coverity scanner.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

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 a2e7d2c..078ad0e 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -1705,7 +1705,7 @@ static int stmmac_open(struct net_device *dev)
>   	priv->dma_rx_size = STMMAC_ALIGN(dma_rxsize);
>   	priv->dma_buf_sz = STMMAC_ALIGN(buf_sz);
>
> -	alloc_dma_desc_resources(priv);
> +	ret = alloc_dma_desc_resources(priv);
>   	if (ret < 0) {
>   		pr_err("%s: DMA descriptors allocation failed\n", __func__);
>   		goto dma_desc_error;
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: stmmac: Check return value of alloc_dma_desc_resources()
  2014-02-22 12:09 [PATCH] net: stmmac: Check return value of alloc_dma_desc_resources() Tobias Klauser
  2014-02-24 15:22 ` Giuseppe CAVALLARO
@ 2014-02-24 23:58 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-02-24 23:58 UTC (permalink / raw)
  To: tklauser; +Cc: peppe.cavallaro, netdev

From: Tobias Klauser <tklauser@distanz.ch>
Date: Sat, 22 Feb 2014 13:09:03 +0100

> alloc_dma_desc_resources() returns an error value and the next line
> actually checks for it, so assign the return value properly.
> 
> Found by the coverity scanner.
> 
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-24 23:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-22 12:09 [PATCH] net: stmmac: Check return value of alloc_dma_desc_resources() Tobias Klauser
2014-02-24 15:22 ` Giuseppe CAVALLARO
2014-02-24 23:58 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.