mirror of https://github.com/xemu-project/xemu.git
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" <edgar.iglesias@gmail.com> Cc: Alistair Francis <alistair.francis@xilinx.com> Cc: Jason Wang <jasowang@redhat.com> Cc: qemu-arm@nongnu.org Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20170608133906.12737-2-ehabkost@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [Commit message clarified] Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
31fe1c4145
commit
a9859c90a5
|
@ -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)
|
||||
|
|
|
@ -981,9 +981,7 @@ static void xilinx_enet_realize(DeviceState *dev, Error **errp)
|
|||
return;
|
||||
|
||||
xilinx_enet_realize_fail:
|
||||
if (!*errp) {
|
||||
*errp = local_err;
|
||||
}
|
||||
error_propagate(errp, local_err);
|
||||
}
|
||||
|
||||
static void xilinx_enet_init(Object *obj)
|
||||
|
|
Loading…
Reference in New Issue