Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp639314pxv; Thu, 15 Jul 2021 12:11:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylwIeOtZh4xrzy5/MIXdR+b+sCDzYguCuyubtUjw0MXUIvPmQv+wUt4pipoJCcOln/HVjl X-Received: by 2002:aa7:c2c4:: with SMTP id m4mr9311023edp.173.1626376263188; Thu, 15 Jul 2021 12:11:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626376263; cv=none; d=google.com; s=arc-20160816; b=YjoRZ6PiAZU5Wp0i51wyQ55HIHL4b7urQjJq46BL7NzFXZX3c28CDfgspAFu3w2a9Y gqKayTf6F8kl+zc2uRdTHDF9IXmjl4Zroq8qvvT1VBMmPV5UMFQOh1PqDEO4eDiUY6Fn X0Zryau6GK1xcmxkt4vegc9OfRfyNzMzWXL+ADSyaHvJaghYp5YCjNdXmVxISRY9R/HV lTzu/x4vtvW8jpfoOUOJtOrfMiVJO77hhO8JeDzXSFljb3KxSRPdTVFwHrgT+L8VIYuk 2I5qQ6AXg+EnHXCouhk13YehrSpUIYQp4/eSLcdicedD03KJYHAjSGufhw+1WTLgxiE4 ESLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OwnL+Xe7B5ZATxfahzLBpjd7H9oekEqgn9S/u4BAgEA=; b=fZd9ULDrG8/BfopmUohKR9hTAc9BDd50FMG0tJGbS26G/HnkaVnFqYNldy9SDIxWaS pY2kk0t2Qag0LVWyVUUCUHpgjDWXmM1YOBAdnQ/NljaSerIgUHrbqg3xQXuat1viXKwc IMgHcgnLsPulxN3+GSMzNJ1RJXwCjfzhWqkEKbYELsxc9dB7DfbOzc1H+ZQIc7gPFFG5 dqPQWwnOoLSBIdXfKyih4iDm7Ytk9uTvWpHGix0AGMR8NAgKf1rXNaHO1QtzBnB8Lley SSTAvYJzycBecM6nLG1iA81vjUXzv8kvnNnzF8JfALpkLwoPz76+KUiiRK7z1Oe2+6gg Pcrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gVYPskta; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nc38si7254324ejc.36.2021.07.15.12.10.39; Thu, 15 Jul 2021 12:11:03 -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=@linuxfoundation.org header.s=korg header.b=gVYPskta; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243062AbhGOTLN (ORCPT + 99 others); Thu, 15 Jul 2021 15:11:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:35104 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242328AbhGOS7h (ORCPT ); Thu, 15 Jul 2021 14:59:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BFF4B613F7; Thu, 15 Jul 2021 18:56:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375389; bh=9f4U18zgpgzwMfn2wNYwWW5+rtYiDiEiuDTIc+NA4i8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gVYPsktaFY2xXLLjpj79Gkj9E5S+KpkwBvcWkStdLnMp7A0eDLFwJJP9cHRY9xize lPVVX/xGvOxoNbQ+cr/4vv9Il3zk3Ypq7RXVEJyXA33ADaFQ74MIdc8YpCdlmjAqE3 jmBpJH1P5AePUPS0MiafmXOwHkgC57GPA85u9rC8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xianting Tian , Leon Romanovsky , "David S. Miller" , Sasha Levin Subject: [PATCH 5.12 064/242] virtio_net: Remove BUG() to avoid machine dead Date: Thu, 15 Jul 2021 20:37:06 +0200 Message-Id: <20210715182603.811640740@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xianting Tian [ 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 --- 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 447582fa20a5..f7ce341bb328 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1558,7 +1558,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; -- 2.30.2