Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1990398pxj; Sat, 5 Jun 2021 09:05:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxtlcPiTbk9PXIyzz5QY9V4V8Ov+nrnUMHILG1ROg9/9Fiff0p9XCrZq5CQx1D012A+IVK X-Received: by 2002:a17:906:b2d1:: with SMTP id cf17mr9886542ejb.225.1622909132940; Sat, 05 Jun 2021 09:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622909132; cv=none; d=google.com; s=arc-20160816; b=YmLY+6j+lmOpxGaE31ga1DJ/bzP7ZVjYaWgD21nNx0g0XN/XwQmGFos/OVMPEOHZ9U GK9Q/Vwtb9vyYO7tIJj7wLwpA+CVaozrc4p7wZPmf6Lx/YgofQPG/ARK4tw/asJCtD3d HOGnctfF3ZTqseGWefoHsvWbgVFl7TTFd/UBPomYyyYOenGG9h1QWbh58TMFUlmiRbjN UFmnDSi9fyZzR03eGLWeJCobK7rrss6G/dEV6SwOHGPmD3MAY7OfAWleJpf+8Axf9wpL Uvnq9IBxL2lWRokkBq2K/iKEIHoLuuWfsNd7NeoW3NhnF085Izz78slU21yGVChHDDFR rpig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=P3aIecmfoywK4mYusAPSwpZJz/rMOG9160tktUCGrgI=; b=zsPMeY9cWwuy0Pug2y8xE0zw7a9HZNp6H6EHnKmeUFr6BGuG0oMUOmGg04iAy6bgmz K0aFxexJnGBIEMv4JBV15lffDQ0VgOn9ppCEozXPX48qMVAAh+qeHVbC8kEoLKRcos1z +33X79Jt/C3z+gf4y4Ktv/ks24Ve+XmGelMsU5/c2xWamOmo7JTP9+iOlcDdGpd8RTGm uSbf46KHcxAyPR59QBTVFVIbIQdUX4+fsjOOgz6vJWlH9dQpKJFH33jrxiIciSHgAvZ+ i4IzcpVKKtssXuJ+1D7393sFqNLYg+h6OrVq/V85m9+BB3RxrZTcGJk2k9BLheFYs/ca GmRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@126.com header.s=s110527 header.b=Qyn4F8Us; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=126.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id be25si7279333edb.359.2021.06.05.09.04.52; Sat, 05 Jun 2021 09:05:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@126.com header.s=s110527 header.b=Qyn4F8Us; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=126.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230085AbhFEQEA (ORCPT + 99 others); Sat, 5 Jun 2021 12:04:00 -0400 Received: from m15113.mail.126.com ([220.181.15.113]:43423 "EHLO m15113.mail.126.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbhFEQEA (ORCPT ); Sat, 5 Jun 2021 12:04:00 -0400 X-Greylist: delayed 1817 seconds by postgrey-1.27 at vger.kernel.org; Sat, 05 Jun 2021 12:03:59 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id; bh=P3aIecmfoywK4mYusA PSwpZJz/rMOG9160tktUCGrgI=; b=Qyn4F8UskAm4T1MMsebRgU8jr+6qGrh31r v8E78W2sstGTMbaKW86irQMEoPnFKOWOayGbSrE4tA9dZxXlbCTEm2aHui9KBgso vJzG5uzFW/b15jZWeU+pxkhPPc1ez4QBgO/hQ+hkeA2P+H7zYzgOiAsWth5qWux7 inkF7YMug= Received: from 192.168.137.133 (unknown [112.10.85.142]) by smtp3 (Coremail) with SMTP id DcmowABHl__CmLtghDc3SA--.48781S3; Sat, 05 Jun 2021 23:31:15 +0800 (CST) From: Xianting Tian To: mst@redhat.com, jasowang@redhat.com, davem@davemloft.net, kuba@kernel.org, linux-kernel@vger.kernel.org Cc: virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, Xianting Tian Subject: [PATCH] [v2] virtio_net: Remove BUG() to avoid machine dead Date: Sat, 5 Jun 2021 11:31:00 -0400 Message-Id: <1622907060-8417-1-git-send-email-xianting_tian@126.com> X-Mailer: git-send-email 1.8.3.1 X-CM-TRANSID: DcmowABHl__CmLtghDc3SA--.48781S3 X-Coremail-Antispam: 1Uf129KBjvdXoWruF18Kr4rJFyfXF1UuF4xXrb_yoW3Krc_Cr yxtF4fGrW5KF12k3yxCa1rZr9xt3WFvF18WwnIq3s3ua1jyFy5Xr92vrnrJry7G340yF98 GFZxJr1v93saqjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU8dOz3UUUUU== X-Originating-IP: [112.10.85.142] X-CM-SenderInfo: h0ld03plqjs3xldqqiyswou0bp/1tbi5gSopFpEBDQX7wAAs4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xianting Tian 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 --- 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 9b6a4a8..7f11ea4 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1623,7 +1623,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; -- 1.8.3.1