qemu-block
[Top][All Lists]
Advanced

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

Re: [PATCH-for-5.1 v3 08/23] hw/arm/armv7m: Add missing error-propagatio


From: Alistair Francis
Subject: Re: [PATCH-for-5.1 v3 08/23] hw/arm/armv7m: Add missing error-propagation code
Date: Mon, 13 Apr 2020 15:10:38 -0700

On Sun, Apr 12, 2020 at 3:54 PM Philippe Mathieu-Daudé <address@hidden> wrote:
>
> Patch created mechanically by running:
>
>   $ spatch \
>     --macro-file scripts/cocci-macro-file.h --include-headers \
>     --sp-file scripts/coccinelle/use-error_propagate-in-realize.cocci \
>     --keep-comments --smpl-spacing --in-place --dir hw
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>

Reviewed-by: Alistair Francis <address@hidden>

Alistair

> ---
>  hw/arm/armv7m.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
> index 7531b97ccd..249a7605f6 100644
> --- a/hw/arm/armv7m.c
> +++ b/hw/arm/armv7m.c
> @@ -168,7 +168,11 @@ static void armv7m_realize(DeviceState *dev, Error 
> **errp)
>      }
>
>      object_property_set_link(OBJECT(s->cpu), OBJECT(&s->container), "memory",
> -                             &error_abort);
> +                             &err);
> +    if (err) {
> +        error_propagate(errp, err);
> +        return;
> +    }
>      if (object_property_find(OBJECT(s->cpu), "idau", NULL)) {
>          object_property_set_link(OBJECT(s->cpu), s->idau, "idau", &err);
>          if (err != NULL) {
> @@ -256,7 +260,11 @@ static void armv7m_realize(DeviceState *dev, Error 
> **errp)
>                  return;
>              }
>              object_property_set_link(obj, OBJECT(s->board_memory),
> -                                     "source-memory", &error_abort);
> +                                     "source-memory", &err);
> +            if (err) {
> +                error_propagate(errp, err);
> +                return;
> +            }
>              object_property_set_bool(obj, true, "realized", &err);
>              if (err != NULL) {
>                  error_propagate(errp, err);
> --
> 2.21.1
>
>



reply via email to

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