Commit 411ea23a authored by Dan Carpenter's avatar Dan Carpenter Committed by Michael S. Tsirkin

virtio_net: Fix error code in probe()

Set a negative error code intead of returning success if the MTU has
been changed to something invalid.

Fixes: fe36cbe0 ("virtio_net: clear MTU when out of range")
Reported-by: default avatarRobert Buhren <robert.buhren@sect.tu-berlin.de>
Reported-by: default avatarFelicitas Hetzelt <file@sect.tu-berlin.de>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/X8pGVJSeeCdII1Ys@mwandaSigned-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
parent ae93d8ea
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment