From: Johannes Berg Date: Tue, 15 Dec 2020 09:52:22 +0000 (+0100) Subject: um: virtio: fix handling of messages without payload X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=10c2b5aeb21c439251e5e828bf1362f89ab3de49;p=linux.git um: virtio: fix handling of messages without payload If we have a message without payload, we call full_read() with len set to 0, which causes it to return -ECONNRESET. Catch this case and explicitly return 0 for it so we can actually use the zero-size config-changed message. Signed-off-by: Johannes Berg Signed-off-by: Richard Weinberger --- diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c index 515d648d3c3d3..ef620caed8e7b 100644 --- a/arch/um/drivers/virtio_uml.c +++ b/arch/um/drivers/virtio_uml.c @@ -97,6 +97,9 @@ static int full_read(int fd, void *buf, int len, bool abortable) { int rc; + if (!len) + return 0; + do { rc = os_read_file(fd, buf, len); if (rc > 0) {