[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH RESEND 3/3] qga: fix compiler warnings (clang 5)
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH RESEND 3/3] qga: fix compiler warnings (clang 5) |
Date: |
Wed, 22 Mar 2017 17:48:44 -0300 |
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>
---
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 73d93eb5ce..8028141534 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -2122,9 +2122,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
- [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers, (continued)
- [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers, Philippe Mathieu-Daudé, 2017/03/22
- Re: [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers, Markus Armbruster, 2017/03/23
- Re: [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers, Gerd Hoffmann, 2017/03/23
- Re: [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers, Marc-André Lureau, 2017/03/23
- Re: [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers, Gerd Hoffmann, 2017/03/23
- Re: [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers, Markus Armbruster, 2017/03/23
- Re: [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers, Gerd Hoffmann, 2017/03/23
- Re: [Qemu-devel] [PATCH RESEND 1/3] usb-ccid: make ccid_write_data_block() cope with null buffers, Markus Armbruster, 2017/03/23
- [Qemu-devel] [PATCH RESEND 2/3] device_tree: fix compiler warnings (clang 5), Philippe Mathieu-Daudé, 2017/03/22
- [Qemu-devel] [PATCH RESEND 3/3] qga: fix compiler warnings (clang 5),
Philippe Mathieu-Daudé <=