Commit 2902bc66 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

net: ethernet: micrel: fix an error code

The dma_mapping_error() function returns true or false.  We should
return -ENOMEM if it there is a dma mapping error.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8cb775bc
...@@ -952,9 +952,8 @@ static int ks8842_alloc_dma_bufs(struct net_device *netdev) ...@@ -952,9 +952,8 @@ static int ks8842_alloc_dma_bufs(struct net_device *netdev)
sg_dma_address(&tx_ctl->sg) = dma_map_single(adapter->dev, sg_dma_address(&tx_ctl->sg) = dma_map_single(adapter->dev,
tx_ctl->buf, DMA_BUFFER_SIZE, DMA_TO_DEVICE); tx_ctl->buf, DMA_BUFFER_SIZE, DMA_TO_DEVICE);
err = dma_mapping_error(adapter->dev, if (dma_mapping_error(adapter->dev, sg_dma_address(&tx_ctl->sg))) {
sg_dma_address(&tx_ctl->sg)); err = -ENOMEM;
if (err) {
sg_dma_address(&tx_ctl->sg) = 0; sg_dma_address(&tx_ctl->sg) = 0;
goto err; goto err;
} }
......
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