mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-27 11:55:53 +00:00
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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8cb775bc0a
commit
2902bc66fa
@ -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,
|
||||
tx_ctl->buf, DMA_BUFFER_SIZE, DMA_TO_DEVICE);
|
||||
err = dma_mapping_error(adapter->dev,
|
||||
sg_dma_address(&tx_ctl->sg));
|
||||
if (err) {
|
||||
if (dma_mapping_error(adapter->dev, sg_dma_address(&tx_ctl->sg))) {
|
||||
err = -ENOMEM;
|
||||
sg_dma_address(&tx_ctl->sg) = 0;
|
||||
goto err;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user