summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorXianting Tian <xianting.tian@linux.alibaba.com>2021-06-05 11:31:00 -0400
committerDavid S. Miller <davem@davemloft.net>2021-06-07 13:06:46 -0700
commit85eb1389458d134bdb75dad502cc026c3753a619 (patch)
treef374e6cbcaf8e7bc5a16f27688b9c4bea75f09a9 /drivers/net
parentec89c2b55dc798096c5c16af4ee0094ff6c8cb3b (diff)
virtio_net: Remove BUG() to avoid machine dead
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>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/virtio_net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index f8f5b8646a43..0416a7e00914 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1636,7 +1636,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;