diff mbox series

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

Message ID 20200923064840.13834-1-olaf@aepfle.de (mailing list archive)
State New, archived
Headers show
Series [v1] tools/libxc: report malloc errors in writev_exact | expand

Commit Message

Olaf Hering Sept. 23, 2020, 6:48 a.m. UTC
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(+)

Comments

Andrew Cooper Sept. 24, 2020, 8:21 p.m. UTC | #1
On 23/09/2020 07:48, Olaf Hering wrote:
> The caller of writev_exact should be notified about malloc errors
> when dealing with partial writes.
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Wei Liu Sept. 30, 2020, 3:07 p.m. UTC | #2
On Thu, Sep 24, 2020 at 09:21:10PM +0100, Andrew Cooper wrote:
> On 23/09/2020 07:48, Olaf Hering wrote:
> > The caller of writev_exact should be notified about malloc errors
> > when dealing with partial writes.
> >
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked + applied.
diff mbox series

Patch

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;
                     }