Skip to content

Commit 28b64cc

Browse files
Finn Thaingregkh
authored andcommitted
net/sonic: Use dma_mapping_error()
[ Upstream commit 26de0b7 ] With CONFIG_DMA_API_DEBUG=y, calling sonic_open() produces the message, "DMA-API: device driver failed to check map error". Add the missing dma_mapping_error() call. Cc: Thomas Bogendoerfer <[email protected]> Signed-off-by: Finn Thain <[email protected]> Acked-by: Thomas Bogendoerfer <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 4888ced commit 28b64cc

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/natsemi

1 file changed

+1
-1
lines changed

drivers/net/ethernet/natsemi/sonic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static int sonic_open(struct net_device *dev)
7171
for (i = 0; i < SONIC_NUM_RRS; i++) {
7272
dma_addr_t laddr = dma_map_single(lp->device, skb_put(lp->rx_skb[i], SONIC_RBSIZE),
7373
SONIC_RBSIZE, DMA_FROM_DEVICE);
74-
if (!laddr) {
74+
if (dma_mapping_error(lp->device, laddr)) {
7575
while(i > 0) { /* free any that were mapped successfully */
7676
i--;
7777
dma_unmap_single(lp->device, lp->rx_laddr[i], SONIC_RBSIZE, DMA_FROM_DEVICE);

0 commit comments

Comments
 (0)