Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9092422pxu; Mon, 28 Dec 2020 06:27:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuo4dGrJS/l2RnZwx7Pgg8fLisUaYM9u6DBxViZamDSdlWI/p6Rl2LGuLn8U6qhkWfMpX1 X-Received: by 2002:a17:906:38c3:: with SMTP id r3mr41800086ejd.193.1609165638726; Mon, 28 Dec 2020 06:27:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609165638; cv=none; d=google.com; s=arc-20160816; b=qOYTGZQbm5gCGSWTBH/2vsmBEEJjnas14EBtBibu4eHG+/wPEGajqSs/w7SLdZajPV gvvfPwrHY1uJJNVMx8fwoafZXRfbLUhipjWZ03T72TjLvkM7gyj7AMVvEPXofdl4xQDN XdOuhXZkf72R64sPkGGF3J18t9RuNQpVGEIsusbb6oqniZGns0gi/ib/EUSGsTkv4fHi QjhKDcFxSiU44QlN2i9g+xX1FgpJRbm15HSdy0q79daT8LA5dwE+66bkIaR64NYhAjK5 O6jkZJmSVgUFNWvfp3QAyr3KITGQXeSxFe5ISBDWcjg021JZ0jrqLZKPLUDnoteGsRt2 KImA== 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=JRWYei+PKiujv1y6vZswRvsqZVgEa3fccsH3TvrFGPg=; b=DWE2fyHZWF+nzZbfB4sUyfzyKdFVV/h2v60G/IZS3LBLLgWnQzNdTnMWsO5rN42p4r RXAKfiJVxIb+zS2jqXxQzZsT09K4JJp3aGOjlP7ZmZtAxtBuqxbQhuFl3wmNPqiHlxsq hm5UhBb5sCdcgrwItPd0AaBgLAp3PqVo0JaRfinNK8/seku03N9AK9XyVLc1MFM7RFuq ltVXn1yarKNl+7fWsO9kfhLXC5H2DFJwIglKoeivAj9DcaRuDyqbNFaf5FbNr83Ovm4w FXGp0dZtqXadi70rqzZ2xQwvU275hP5PBK2xj92KsYD3xf6X9ArWNgQXVwNFv63zqlRX kFOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RNSlv7la; 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 l2si20858339ede.232.2020.12.28.06.26.55; Mon, 28 Dec 2020 06:27:18 -0800 (PST) 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=RNSlv7la; 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 S2441688AbgL1OWP (ORCPT + 99 others); Mon, 28 Dec 2020 09:22:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:57454 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502618AbgL1OWM (ORCPT ); Mon, 28 Dec 2020 09:22:12 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id F3C6222B30; Mon, 28 Dec 2020 14:21:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165316; bh=RnWXGoe3rqK+CbVc7vEq6fNA0KGY+rq+NBemDoqYrDw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RNSlv7laGr9RWpBcYC7Jo6OdBqZ/LDWgvUaL8ieY7StV5GgjDQcOQviI6bLur5Y4+ vXqZvrvwkPu05PPLhWS9HYEgX1j/HaBIU4xWb8rCNuo7UPuFBu4EMUY8rw5CC+ZrlF DdVc4JdsbRAlOJwe2nGgSxsrIgIpRbtMqoWSLR8A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robert Buhren , Felicitas Hetzelt , Dan Carpenter , "Michael S. Tsirkin" , Jason Wang , Sasha Levin Subject: [PATCH 5.10 490/717] virtio_net: Fix error code in probe() Date: Mon, 28 Dec 2020 13:48:08 +0100 Message-Id: <20201228125044.440786954@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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: Dan Carpenter [ Upstream commit 411ea23a76526e6efed0b601abb603d3c981b333 ] Set a negative error code intead of returning success if the MTU has been changed to something invalid. Fixes: fe36cbe0671e ("virtio_net: clear MTU when out of range") Reported-by: Robert Buhren Reported-by: Felicitas Hetzelt Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/X8pGVJSeeCdII1Ys@mwanda Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Signed-off-by: Sasha Levin --- drivers/net/virtio_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 21b71148c5324..34bb95dd92392 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -3072,6 +3072,7 @@ static int virtnet_probe(struct virtio_device *vdev) dev_err(&vdev->dev, "device MTU appears to have changed it is now %d < %d", mtu, dev->min_mtu); + err = -EINVAL; goto free; } -- 2.27.0