[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201228124951.836754240@linuxfoundation.org>
Date: Mon, 28 Dec 2020 13:49:00 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Robert Buhren <robert.buhren@...t.tu-berlin.de>,
Felicitas Hetzelt <file@...t.tu-berlin.de>,
Dan Carpenter <dan.carpenter@...cle.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.4 304/453] virtio_net: Fix error code in probe()
From: Dan Carpenter <dan.carpenter@...cle.com>
[ 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 <robert.buhren@...t.tu-berlin.de>
Reported-by: Felicitas Hetzelt <file@...t.tu-berlin.de>
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
Link: https://lore.kernel.org/r/X8pGVJSeeCdII1Ys@mwanda
Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
Acked-by: Jason Wang <jasowang@...hat.com>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
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 99e1a7bc06886..7cc8f405be1ad 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -3114,6 +3114,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
Powered by blists - more mailing lists