qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 3/4] qga: fix compiler warnings (clang 5)


From: Michael Roth
Subject: Re: [Qemu-devel] [PATCH v2 3/4] qga: fix compiler warnings (clang 5)
Date: Mon, 10 Apr 2017 20:01:49 -0500
User-agent: alot/0.5.1

Quoting Philippe Mathieu-Daudé (2017-04-07 17:20:15)
> static code analyzer complain:
> 
> qga/commands-posix.c:2127:9: warning: Null pointer passed as an argument to a 
> 'nonnull' parameter
>         closedir(dp);
>         ^~~~~~~~~~~~
> 
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> Reviewed-by: Marc-André Lureau <address@hidden>

Reviewed-by: Michael Roth <address@hidden>

> ---
>  qga/commands-posix.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index 915df9ed90..fc45102a1e 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -2124,9 +2124,11 @@ static void transfer_memory_block(GuestMemoryBlock 
> *mem_blk, bool sys2memblk,
>           * we think this VM does not support online/offline memory block,
>           * any other solution?
>           */
> -        if (!dp && errno == ENOENT) {
> -            result->response =
> -                GUEST_MEMORY_BLOCK_RESPONSE_TYPE_OPERATION_NOT_SUPPORTED;
> +        if (!dp) {
> +            if (errno == ENOENT) {
> +                result->response =
> +                    GUEST_MEMORY_BLOCK_RESPONSE_TYPE_OPERATION_NOT_SUPPORTED;
> +            }
>              goto out1;
>          }
>          closedir(dp);
> -- 
> 2.11.0
> 




reply via email to

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