diff options
Diffstat (limited to 'drivers/net/mlx4/en_rx.c')
-rw-r--r-- | drivers/net/mlx4/en_rx.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c index cd084de322f4..03b781a7a182 100644 --- a/drivers/net/mlx4/en_rx.c +++ b/drivers/net/mlx4/en_rx.c | |||
@@ -462,8 +462,9 @@ static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv, | |||
462 | PCI_DMA_FROMDEVICE); | 462 | PCI_DMA_FROMDEVICE); |
463 | } | 463 | } |
464 | /* Adjust size of last fragment to match actual length */ | 464 | /* Adjust size of last fragment to match actual length */ |
465 | skb_frags_rx[nr - 1].size = length - | 465 | if (nr > 0) |
466 | priv->frag_info[nr - 1].frag_prefix_size; | 466 | skb_frags_rx[nr - 1].size = length - |
467 | priv->frag_info[nr - 1].frag_prefix_size; | ||
467 | return nr; | 468 | return nr; |
468 | 469 | ||
469 | fail: | 470 | fail: |