summaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4/en_rx.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-08-13 02:44:53 +0200
committerDavid S. Miller <davem@davemloft.net>2009-08-13 02:44:53 +0200
commitaa11d958d1a6572eda08214d7c6a735804fe48a5 (patch)
treed025b05270ad1e010660d17eeadc6ac3c1abbd7d /drivers/net/mlx4/en_rx.c
parentnet,pppoe: fixup module init/exit subsequent calls (diff)
parentRevert "libertas: Read buffer overflow" (diff)
downloadlinux-aa11d958d1a6572eda08214d7c6a735804fe48a5.tar.xz
linux-aa11d958d1a6572eda08214d7c6a735804fe48a5.zip
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: arch/microblaze/include/asm/socket.h
Diffstat (limited to 'drivers/net/mlx4/en_rx.c')
-rw-r--r--drivers/net/mlx4/en_rx.c5
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,
PCI_DMA_FROMDEVICE);
}
/* Adjust size of last fragment to match actual length */
- skb_frags_rx[nr - 1].size = length -
- priv->frag_info[nr - 1].frag_prefix_size;
+ if (nr > 0)
+ skb_frags_rx[nr - 1].size = length -
+ priv->frag_info[nr - 1].frag_prefix_size;
return nr;
fail: