summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2020-12-15 10:52:22 +0100
committerRichard Weinberger <richard@nod.at>2021-02-12 21:21:52 +0100
commit10c2b5aeb21c439251e5e828bf1362f89ab3de49 (patch)
treeab647ac4c3ec4259c6c702664c5f822ae7672fa9 /arch
parent74e919d2307d9014400c818b82e752c623a4da94 (diff)
downloadlinux-10c2b5aeb21c439251e5e828bf1362f89ab3de49.tar.bz2
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 <johannes.berg@intel.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch')
-rw-r--r--arch/um/drivers/virtio_uml.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c
index 515d648d3c3d..ef620caed8e7 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) {