aboutsummaryrefslogtreecommitdiff
path: root/qga/commands-posix.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2017-04-07 19:20:15 -0300
committerMichael Tokarev <mjt@tls.msk.ru>2017-05-07 09:57:51 +0300
commit9879f5ac62c1e0c92a5ff2f4a0ada1b66d43da90 (patch)
treec902cc5fdb672d2ce6f648e02b8e332e28008574 /qga/commands-posix.c
parent21a9ad2f159e4cafd090cc2b47ce322e024c7363 (diff)
qga: fix compiler warnings (clang 5)
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é <f4bug@amsat.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'qga/commands-posix.c')
-rw-r--r--qga/commands-posix.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index ba06be4c86..284ecc6d7e 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -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);