Skip to content

Commit

Permalink
amd-xgbe: Check for complete packet on skb allocation error
Browse files Browse the repository at this point in the history
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 <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Lendacky, Thomas authored and David S. Miller committed Nov 7, 2014
1 parent e98c72c commit f5eecbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/amd/xgbe/xgbe-drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,7 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget)
skb = xgbe_create_skb(pdata, rdata, &put_len);
if (!skb) {
error = 1;
goto read_again;
goto skip_data;
}
}

Expand All @@ -1926,10 +1926,10 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget)
}
}

skip_data:
if (incomplete || context_next)
goto read_again;

/* Stray Context Descriptor? */
if (!skb)
goto next_packet;

Expand Down

0 comments on commit f5eecbb

Please sign in to comment.