summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorChristoph Paasch <christoph.paasch@uclouvain.be>2013-03-20 08:59:41 +0000
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2013-03-27 03:13:27 -0700
commit065946c65a61943b4c609a0a1b1bac6742b3b593 (patch)
tree8bdd2382bebd688b408854fc7448e051a1ce6612 /drivers/net/ethernet
parentd6b057b5dbba97e6ba13aace5270babd7c8b658c (diff)
downloadlinux-next-065946c65a61943b4c609a0a1b1bac6742b3b593.tar.gz
ixgb: Add missing dma_mapping_error-call in ixgb_alloc_rx_buffers
After dma_map_single, dma_mapping_error must be called. It seems safe to not free the skb allocated in this function, as the skb can be reused later. Additionally this patch fixes one coding-style error. Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/intel/ixgb/ixgb_main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index ea4808373435..b5f94abe3cff 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
@@ -2159,6 +2159,10 @@ map_skb:
skb->data,
adapter->rx_buffer_len,
DMA_FROM_DEVICE);
+ if (dma_mapping_error(&pdev->dev, buffer_info->dma)) {
+ adapter->alloc_rx_buff_failed++;
+ break;
+ }
rx_desc = IXGB_RX_DESC(*rx_ring, i);
rx_desc->buff_addr = cpu_to_le64(buffer_info->dma);
@@ -2168,7 +2172,8 @@ map_skb:
rx_desc->status = 0;
- if (++i == rx_ring->count) i = 0;
+ if (++i == rx_ring->count)
+ i = 0;
buffer_info = &rx_ring->buffer_info[i];
}