[PATCH v1] tools/libxc: report malloc errors in writev_exact

Olaf Hering posted 1 patch 3 years, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20200923064840.13834-1-olaf@aepfle.de
Maintainers: Wei Liu <wl@xen.org>, Ian Jackson <iwj@xenproject.org>
tools/libs/ctrl/xc_private.c | 1 +
1 file changed, 1 insertion(+)
[PATCH v1] tools/libxc: report malloc errors in writev_exact
Posted by Olaf Hering 3 years, 6 months ago
The caller of writev_exact should be notified about malloc errors
when dealing with partial writes.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---


I think this is a backport candidate...


 tools/libs/ctrl/xc_private.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/libs/ctrl/xc_private.c b/tools/libs/ctrl/xc_private.c
index 8af96b1b7e..3fab94f9c0 100644
--- a/tools/libs/ctrl/xc_private.c
+++ b/tools/libs/ctrl/xc_private.c
@@ -721,6 +721,7 @@ int writev_exact(int fd, const struct iovec *iov, int iovcnt)
                     if ( !local_iov )
                     {
                         saved_errno = ENOMEM;
+                        rc = -1;
                         goto out;
                     }