From fb2ff7dd0f1b365530b910afd99898cc4421ab1d Mon Sep 17 00:00:00 2001 From: Xianting Tian Date: Mon, 2 Aug 2021 11:01:18 +0800 Subject: [PATCH] virtio_net: Remove BUG() to avoid machine dead stable inclusion from linux-4.19.198 commit 34218ccb387c1e5e94b2baa6e337fb0367edede0 -------------------------------- [ Upstream commit 85eb1389458d134bdb75dad502cc026c3753a619 ] We should not directly BUG() when there is hdr error, it is better to output a print when such error happens. Currently, the caller of xmit_skb() already did it. Signed-off-by: Xianting Tian Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Yang Yingliang --- drivers/net/virtio_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index e3553056cec0..3595127f714f 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1536,7 +1536,7 @@ static int xmit_skb(struct send_queue *sq, struct sk_buff *skb) if (virtio_net_hdr_from_skb(skb, &hdr->hdr, virtio_is_little_endian(vi->vdev), false, 0)) - BUG(); + return -EPROTO; if (vi->mergeable_rx_bufs) hdr->num_buffers = 0; -- GitLab