Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp627940pxv; Thu, 15 Jul 2021 11:55:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwerasA3wX8mIE4asM8RjWeu9bnKfpM4MAQxxfI5dgU+oeGzbM+K5rg+8KqM/13iMlFzQ2M X-Received: by 2002:a92:8707:: with SMTP id m7mr3648774ild.177.1626375326407; Thu, 15 Jul 2021 11:55:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626375326; cv=none; d=google.com; s=arc-20160816; b=IdrInkMLCZOvzccVwKqzAZJl3oDGi6R0q0OVItA5DX3nTX6wavWwvZLVfFzQBBhbk/ QDT64pD3z8nrrN+AAYx1PIsdjW0ztEKpv8/xnhtrheMj5QXYX06fghE5wwEKPlpP19A6 1GywBJlIlPAGsj3bma8eR4BbvMHPsHlKC6N4k3Pw61dO1/7ZiT/y9mDEEUYYg0zkn0c9 jGbdTFoLmKqVlsXBOgqmhyPWC/w4U/8TaFpBED9jbzLluyw5d5pln5x6Yw/4PZ2sJtJy KduoR+YGMejZ9aiQTPzkjaCPEA8JjAsAEB/rtOWD/3HffScPE5hhbhxenSRZUQ3XGFDt gBCw== 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=5jHUTFP3MHM/p8dxLuAqGh0yj0I5ri+l/98bH009QP8=; b=H5sEfYhJJDiO8LXCn6sr12mvP0oH6zaoREjAlMM98PPXc+3OUpp4SrS6KJ9pkPl8NK uiVTx5rz3+Z5LofItnoWIfKj8O8Kb/J9KcTQhGhqpL5TIGlfM1xqxYUd8FNSRLwi54dW jKhE520anpyOzlEJcU1PSJ2oSvULteKR+aKDtdpzCe3WHZ8ofPazRNPRtJeynI/LAJIU CVqb0EUiRs39rhXYQ1lAkbkNtGdYcnyRQOK6YhZtaWvA6yUC9U9O9naDvfKZZh5DUNwM pN+RY9lTtwr6+Y8q+cszPmuBkUdAqvYnftV6cMHdZ8Zs1b4E4I0g/o1PgMB4YTqFMbU3 wAlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PSqCLoCx; 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 a1si1649076jat.32.2021.07.15.11.55.14; Thu, 15 Jul 2021 11:55:26 -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=PSqCLoCx; 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 S241917AbhGOS5i (ORCPT + 99 others); Thu, 15 Jul 2021 14:57:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:54984 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235956AbhGOSvk (ORCPT ); Thu, 15 Jul 2021 14:51:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6B6C0613C4; Thu, 15 Jul 2021 18:48:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626374926; bh=Cw2ARdHoUyronOO5hDgZF3fHmbP47LLSQ6y+NnXGX74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PSqCLoCxk2enTeMhPtbEbS7FvG12V7r80NAdF3If5k8DWIf/rYOEJQGY//ZV3qbP7 z8PwJRru2ACgBUz27qFF/X/1aRFbfGe9xPp+fDWWKkAecfujNfoPaWCaxIdp40jRP9 UOhLDHieFBT4G+r6XnLZj4Nfm0l9xbTg9TxEgfjI= 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.10 058/215] virtio_net: Remove BUG() to avoid machine dead Date: Thu, 15 Jul 2021 20:37:10 +0200 Message-Id: <20210715182609.713978013@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182558.381078833@linuxfoundation.org> References: <20210715182558.381078833@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 e2c6c5675ec6..91e0e6254a01 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1563,7 +1563,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