]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
tools/mfndump: Avoid unintentional NULL dereference
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 13 Mar 2014 11:09:07 +0000 (11:09 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 13 Mar 2014 18:03:37 +0000 (18:03 +0000)
If we failed to open an xc interface, using xch to log an error will end in
tears.  Print to stderr instead, as we are bailing immediately later.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Coverity-id: 1191885
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
tools/misc/xen-mfndump.c

index 8064527ecff16717d77c68ab6449adac04e3eb51..e1ea536754ec145c7b0a64bbb382dcebf53e8067 100644 (file)
@@ -400,7 +400,7 @@ int main(int argc, char *argv[])
     xch = xc_interface_open(0, 0, 0);
     if ( !xch )
     {
-        ERROR("Failed to open an xc handler");
+        fprintf(stderr, "Failed to open an xc handler");
         return 1;
     }