Skip to content

Commit

Permalink
qga: fix compiler warnings (clang 5)
Browse files Browse the repository at this point in the history
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é <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Reviewed-by: Michael Roth <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
  • Loading branch information
philmd authored and Michael Tokarev committed May 7, 2017
1 parent 21a9ad2 commit 9879f5a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions qga/commands-posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -2125,9 +2125,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);
Expand Down

0 comments on commit 9879f5a

Please sign in to comment.