linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virtio_net: Remove BUG() to aviod machine dead
@ 2021-05-18  9:46 Xianting Tian
  2021-05-18  9:54 ` Michael S. Tsirkin
  2021-05-20  7:35 ` Stefano Garzarella
  0 siblings, 2 replies; 8+ messages in thread
From: Xianting Tian @ 2021-05-18  9:46 UTC (permalink / raw)
  To: mst, jasowang, davem, kuba; +Cc: virtualization, netdev, linux-kernel

When met error, we output a print to avoid a BUG().

Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
---
  drivers/net/virtio_net.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index c921ebf3ae82..a66174d13e81 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1647,9 +1647,8 @@ static int xmit_skb(struct send_queue *sq, struct 
sk_buff *skb)
  		hdr = skb_vnet_hdr(skb);

  	if (virtio_net_hdr_from_skb(skb, &hdr->hdr,
-				    virtio_is_little_endian(vi->vdev), false,
-				    0))
-		BUG();
+				virtio_is_little_endian(vi->vdev), false, 0))
+		return -EPROTO;

  	if (vi->mergeable_rx_bufs)
  		hdr->num_buffers = 0;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-06-02 12:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18  9:46 [PATCH] virtio_net: Remove BUG() to aviod machine dead Xianting Tian
2021-05-18  9:54 ` Michael S. Tsirkin
2021-05-19 14:18   ` Xianting Tian
2021-05-25  6:19     ` Jason Wang
2021-06-02  5:59       ` Leon Romanovsky
2021-06-02  7:14         ` Jason Wang
2021-06-02 12:54           ` Leon Romanovsky
2021-05-20  7:35 ` Stefano Garzarella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).