diff options
Diffstat (limited to 'drivers/net/mlx4')
-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 91bdfdfd431f..3ac0404d0d11 100644 --- a/drivers/net/mlx4/en_rx.c +++ b/drivers/net/mlx4/en_rx.c | |||
@@ -506,8 +506,9 @@ static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv, | |||
506 | PCI_DMA_FROMDEVICE); | 506 | PCI_DMA_FROMDEVICE); |
507 | } | 507 | } |
508 | /* Adjust size of last fragment to match actual length */ | 508 | /* Adjust size of last fragment to match actual length */ |
509 | skb_frags_rx[nr - 1].size = length - | 509 | if (nr > 0) |
510 | priv->frag_info[nr - 1].frag_prefix_size; | 510 | skb_frags_rx[nr - 1].size = length - |
511 | priv->frag_info[nr - 1].frag_prefix_size; | ||
511 | return nr; | 512 | return nr; |
512 | 513 | ||
513 | fail: | 514 | fail: |