From f5eecbbef0b7d28b171b3b873e1e4a69aabd7b58 Mon Sep 17 00:00:00 2001 From: "Lendacky, Thomas" Date: Thu, 6 Nov 2014 17:02:19 -0600 Subject: [PATCH] amd-xgbe: Check for complete packet on skb allocation error If the skb allocation fails during receive processing, the driver would continue reading descriptors without first determining if there were any more descriptors for the current packet. Update the code to check whether more descriptors are associated with the current packet or whether to move on to the next descriptor as a new packet. Signed-off-by: Tom Lendacky Signed-off-by: David S. Miller --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c index ec5fff38108d..0544931329d1 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c @@ -1908,7 +1908,7 @@ read_again: skb = xgbe_create_skb(pdata, rdata, &put_len); if (!skb) { error = 1; - goto read_again; + goto skip_data; } } @@ -1926,10 +1926,10 @@ read_again: } } +skip_data: if (incomplete || context_next) goto read_again; - /* Stray Context Descriptor? */ if (!skb) goto next_packet;