diff options
-rw-r--r-- | drivers/net/mlx4/en_rx.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c index 0cbb78ca7b29..7942c4d3cd88 100644 --- a/drivers/net/mlx4/en_rx.c +++ b/drivers/net/mlx4/en_rx.c | |||
@@ -610,6 +610,10 @@ static struct sk_buff *mlx4_en_rx_skb(struct mlx4_en_priv *priv, | |||
610 | used_frags = mlx4_en_complete_rx_desc(priv, rx_desc, skb_frags, | 610 | used_frags = mlx4_en_complete_rx_desc(priv, rx_desc, skb_frags, |
611 | skb_shinfo(skb)->frags, | 611 | skb_shinfo(skb)->frags, |
612 | page_alloc, length); | 612 | page_alloc, length); |
613 | if (unlikely(!used_frags)) { | ||
614 | kfree_skb(skb); | ||
615 | return NULL; | ||
616 | } | ||
613 | skb_shinfo(skb)->nr_frags = used_frags; | 617 | skb_shinfo(skb)->nr_frags = used_frags; |
614 | 618 | ||
615 | /* Copy headers into the skb linear buffer */ | 619 | /* Copy headers into the skb linear buffer */ |