From e927d4be842cf44e8f0c92fb8c077a0e0f0383bb Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Thu, 13 Mar 2014 11:09:07 +0000 Subject: [PATCH] tools/mfndump: Avoid unintentional NULL dereference 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 Coverity-id: 1191885 Acked-by: Ian Campbell CC: Ian Jackson Acked-by: Dario Faggioli --- tools/misc/xen-mfndump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/misc/xen-mfndump.c b/tools/misc/xen-mfndump.c index 8064527ecf..e1ea536754 100644 --- a/tools/misc/xen-mfndump.c +++ b/tools/misc/xen-mfndump.c @@ -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; } -- 2.39.5