Commit 7262b7b2 authored by Tobias Klauser's avatar Tobias Klauser Committed by David S. Miller

net: stmmac: Check return value of alloc_dma_desc_resources()

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: default avatarTobias Klauser <tklauser@distanz.ch>
Acked-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0e7ede80
...@@ -1705,7 +1705,7 @@ static int stmmac_open(struct net_device *dev) ...@@ -1705,7 +1705,7 @@ static int stmmac_open(struct net_device *dev)
priv->dma_rx_size = STMMAC_ALIGN(dma_rxsize); priv->dma_rx_size = STMMAC_ALIGN(dma_rxsize);
priv->dma_buf_sz = STMMAC_ALIGN(buf_sz); priv->dma_buf_sz = STMMAC_ALIGN(buf_sz);
alloc_dma_desc_resources(priv); ret = alloc_dma_desc_resources(priv);
if (ret < 0) { if (ret < 0) {
pr_err("%s: DMA descriptors allocation failed\n", __func__); pr_err("%s: DMA descriptors allocation failed\n", __func__);
goto dma_desc_error; goto dma_desc_error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment