qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/4] graphic_console_init: do not receive unneeded e


From: Kirill Batuzov
Subject: [Qemu-devel] [PATCH 3/4] graphic_console_init: do not receive unneeded error descriptions
Date: Fri, 18 Apr 2014 17:41:23 +0400

Error set by error_set is dynamically allocated and needs to be cleared
properly later.  graphic_console_init neither needs error descriptions nor frees
them.  Pass NULL instead of actual pointers to avoid unnecessary memory
allocations.

Signed-off-by: Kirill Batuzov <address@hidden>
---
 ui/console.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/ui/console.c b/ui/console.c
index e057755..438b6bd 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1590,7 +1590,6 @@ QemuConsole *graphic_console_init(DeviceState *dev, 
uint32_t head,
                                   const GraphicHwOps *hw_ops,
                                   void *opaque)
 {
-    Error *local_err = NULL;
     int width = 640;
     int height = 480;
     QemuConsole *s;
@@ -1602,10 +1601,8 @@ QemuConsole *graphic_console_init(DeviceState *dev, 
uint32_t head,
     s->hw_ops = hw_ops;
     s->hw = opaque;
     if (dev) {
-        object_property_set_link(OBJECT(s), OBJECT(dev),
-                                 "device", &local_err);
-        object_property_set_int(OBJECT(s), head,
-                                "head", &local_err);
+        object_property_set_link(OBJECT(s), OBJECT(dev), "device", NULL);
+        object_property_set_int(OBJECT(s), head, "head", NULL);
     }
 
     s->surface = qemu_create_displaysurface(width, height);
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]