Patch created mechanically by running: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/add-missing-error_propagate.cocci \ --keep-comments --smpl-spacing --dir hw
Then review showed this file has a 'xilinx_axidma_realize_fail' label that calls error_propagate(). Updated the patch to use the label. Reviewed-by: Alistair Francis <alistair.fran...@wdc.com> Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org> --- v2: New cocci patch generated both transformations (Peter noticed v1 only catched one) --- hw/dma/xilinx_axidma.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index 018f36991b..2d36346319 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -531,6 +531,9 @@ static void xilinx_axidma_realize(DeviceState *dev, Error **errp) object_property_allow_set_link, OBJ_PROP_LINK_STRONG, &local_err); + if (local_err) { + goto xilinx_axidma_realize_fail; + } object_property_add_link(OBJECT(cs), "dma", TYPE_XILINX_AXI_DMA, (Object **)&cs->dma, object_property_allow_set_link, @@ -540,6 +543,9 @@ static void xilinx_axidma_realize(DeviceState *dev, Error **errp) goto xilinx_axidma_realize_fail; } object_property_set_link(OBJECT(ds), OBJECT(s), "dma", &local_err); + if (local_err) { + goto xilinx_axidma_realize_fail; + } object_property_set_link(OBJECT(cs), OBJECT(s), "dma", &local_err); if (local_err) { goto xilinx_axidma_realize_fail; -- 2.21.1