qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [FOR 0.12 PATCH] usb-host: check mon before using it.
@ 2009-12-15 10:43 Gerd Hoffmann
  0 siblings, 0 replies; only message in thread
From: Gerd Hoffmann @ 2009-12-15 10:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann


Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 usb-linux.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/usb-linux.c b/usb-linux.c
index 105ce88..88728e9 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -1206,7 +1206,8 @@ static int usb_host_read_file(char *line, size_t line_size, const char *device_f
         ret = 1;
 #if 0
     } else {
-        monitor_printf(mon, "husb: could not open %s\n", filename);
+        if (mon)
+            monitor_printf(mon, "husb: could not open %s\n", filename);
 #endif
     }
 
@@ -1339,15 +1340,17 @@ static int usb_host_scan(void *opaque, USBScanFunc *func)
         }
     found_devices:
         if (!usb_fs_type) {
-            monitor_printf(mon, "husb: unable to access USB devices\n");
+            if (mon)
+                monitor_printf(mon, "husb: unable to access USB devices\n");
             return -ENOENT;
         }
 
         /* the module setting (used later for opening devices) */
         usb_host_device_path = qemu_mallocz(strlen(devpath)+1);
         strcpy(usb_host_device_path, devpath);
-        monitor_printf(mon, "husb: using %s file-system with %s\n",
-                       fs_type[usb_fs_type], usb_host_device_path);
+        if (mon)
+            monitor_printf(mon, "husb: using %s file-system with %s\n",
+                           fs_type[usb_fs_type], usb_host_device_path);
     }
 
     switch (usb_fs_type) {
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-15 10:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-15 10:43 [Qemu-devel] [FOR 0.12 PATCH] usb-host: check mon before using it Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).