hw/arm/sysbus-fdt: Replace error_setg(&error_fatal) by error_report() + exit()
commit88bbd3fb60bf16ed3e974276814df4e9c4b2b92f
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Fri, 29 Jun 2018 14:11:00 +0000 (29 15:11 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 29 Jun 2018 14:11:00 +0000 (29 15:11 +0100)
tree29180de2eeb8382c724be65bc8fba51bf009e692
parent329b72916f54a6ef2842ae172c086986af19c677
hw/arm/sysbus-fdt: Replace error_setg(&error_fatal) by error_report() + exit()

Use error_report() + exit() instead of error_setg(&error_fatal),
as suggested by the "qapi/error.h" documentation:

   Please don't error_setg(&error_fatal, ...), use error_report() and
   exit(), because that's more obvious.

This fixes CID 1352173:
    "Passing null pointer dt_name to qemu_fdt_node_path, which dereferences it."

And this also fixes:

    hw/arm/sysbus-fdt.c:322:9: warning: Array access (from variable 'node_path') results in a null pointer dereference
        if (node_path[1]) {
            ^~~~~~~~~~~~

Fixes: Coverity CID 1352173 (Dereference after null check)
Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Message-id: 20180625165749.3910-3-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/sysbus-fdt.c