Skip to content

Commit

Permalink
virtio_net: Remove BUG() to avoid machine dead
Browse files Browse the repository at this point in the history
[ Upstream commit 85eb138 ]

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 <xianting.tian@linux.alibaba.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Xianting Tian authored and gregkh committed Jul 19, 2021
1 parent 47cafc5 commit e8f0393
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/virtio_net.c
Expand Up @@ -1625,7 +1625,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;
Expand Down

0 comments on commit e8f0393

Please sign in to comment.