From a9859c90a5db200fd4f63ab2cdc973343348b9ef Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Thu, 8 Jun 2017 10:39:02 -0300 Subject: xilinx: Fix latent error handling bug Assigning directly to *errp is not valid, as errp may be null, &error_fatal, or &error_abort. The !*errp conditional protects against the latter two, but we then leak @local_err. Fortunately, the qdev core always passes pointer to null, so this is "merely" a latent bug. Use error_propagate() instead. Cc: "Edgar E. Iglesias" Cc: Alistair Francis Cc: Jason Wang Cc: qemu-arm@nongnu.org Signed-off-by: Eduardo Habkost Message-Id: <20170608133906.12737-2-ehabkost@redhat.com> Reviewed-by: Alistair Francis Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster [Commit message clarified] Signed-off-by: Markus Armbruster --- hw/dma/xilinx_axidma.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'hw/dma') diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index 6065689ad1..3987b5ff96 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -554,9 +554,7 @@ static void xilinx_axidma_realize(DeviceState *dev, Error **errp) return; xilinx_axidma_realize_fail: - if (!*errp) { - *errp = local_err; - } + error_propagate(errp, local_err); } static void xilinx_axidma_init(Object *obj) -- cgit v1.2.3