Unverified Commit fb35fa22 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 4c131939 4d1d09ad
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -2765,6 +2765,14 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget)
			buf2_len = xgbe_rx_buf2_len(rdata, packet, len);
			len += buf2_len;

			if (buf2_len > rdata->rx.buf.dma_len) {
				/* Hardware inconsistency within the descriptors
				 * that has resulted in a length underflow.
				 */
				error = 1;
				goto skip_data;
			}

			if (!skb) {
				skb = xgbe_create_skb(pdata, napi, rdata,
						      buf1_len);
@@ -2794,8 +2802,10 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget)
		if (!last || context_next)
			goto read_again;

		if (!skb)
		if (!skb || error) {
			dev_kfree_skb(skb);
			goto next_packet;
		}

		/* Be sure we don't exceed the configured MTU */
		max_len = netdev->mtu + ETH_HLEN;