[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/4] graphic_console_init: do not receive unneed
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH 3/4] graphic_console_init: do not receive unneeded error descriptions |
Date: |
Fri, 18 Apr 2014 18:32:26 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
Am 18.04.2014 15:41, schrieb Kirill Batuzov:
> 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);
I guess it would be better to use &error_abort rather than failing
silently. CC'ing Gerd.
Regards,
Andreas
> }
>
> s->surface = qemu_create_displaysurface(width, height);
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
[Qemu-devel] [PATCH 4/4] PortioList: fix PortioList uses so they do not leak memory, Kirill Batuzov, 2014/04/18
[Qemu-devel] [PATCH 1/4] Replace acpi_pcihp_get_bsel with generic object_property_get_int, Kirill Batuzov, 2014/04/18