diff mbox

hmp: Fix warning from smatch (wrong argument in function call)

Message ID 1423406448-31918-1-git-send-email-sw@weilnetz.de
State Accepted
Headers show

Commit Message

Stefan Weil Feb. 8, 2015, 2:40 p.m. UTC
Fix this warning:
hmp.c:414:38: warning: Using plain integer as NULL pointer

qmp_query_block expects a pointer argument, so passing false is wrong.

Cc: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 hmp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Markus Armbruster Feb. 9, 2015, 9:40 a.m. UTC | #1
Stefan Weil <sw@weilnetz.de> writes:

> Fix this warning:
> hmp.c:414:38: warning: Using plain integer as NULL pointer
>
> qmp_query_block expects a pointer argument, so passing false is wrong.
>
> Cc: Luiz Capitulino <lcapitulino@redhat.com>
> Signed-off-by: Stefan Weil <sw@weilnetz.de>

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Michael Tokarev Feb. 10, 2015, 7:08 p.m. UTC | #2
08.02.2015 17:40, Stefan Weil wrote:
> Fix this warning:
> hmp.c:414:38: warning: Using plain integer as NULL pointer
> 
> qmp_query_block expects a pointer argument, so passing false is wrong.

Applied to -trivial.  It turns out zero and zero are different! :)

Thanks,

/mjt
diff mbox

Patch

diff --git a/hmp.c b/hmp.c
index a42c5c0..6926960 100644
--- a/hmp.c
+++ b/hmp.c
@@ -411,7 +411,7 @@  void hmp_info_block(Monitor *mon, const QDict *qdict)
 
     /* Print BlockBackend information */
     if (!nodes) {
-        block_list = qmp_query_block(false);
+        block_list = qmp_query_block(NULL);
     } else {
         block_list = NULL;
     }