qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] io: error_prepend() in qio_channel_readv_full_all() causes s


From: Daniel P . Berrangé
Subject: Re: [PATCH] io: error_prepend() in qio_channel_readv_full_all() causes segfault
Date: Fri, 12 Feb 2021 11:16:58 +0000
User-agent: Mutt/1.14.6 (2020-07-11)

On Fri, Feb 12, 2021 at 06:16:07AM -0500, Jagannathan Raman wrote:
> Using error_prepend() in qio_channel_readv_full_all() causes a segfault
> as errp is not set when ret is 0. This results in the failure of iotest
> 83. Replacing with error_setg() fixes the problem.
> 
> Additionally, removes a full stop at the end of error message
> 
> Reported-by: Max Reitz <mreitz@redhat.com>
> Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
> ---
>  io/channel.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/io/channel.c b/io/channel.c
> index 4555021..e8b019d 100644
> --- a/io/channel.c
> +++ b/io/channel.c
> @@ -202,8 +202,7 @@ int qio_channel_readv_full_all(QIOChannel *ioc,
>      int ret = qio_channel_readv_full_all_eof(ioc, iov, niov, fds, nfds, 
> errp);
>  
>      if (ret == 0) {
> -        error_prepend(errp,
> -                      "Unexpected end-of-file before all data were read.");
> +        error_setg(errp, "Unexpected end-of-file before all data were read");
>          return -1;
>      }
>      if (ret == 1) {

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]