]> git.proxmox.com Git - mirror_qemu.git/commit
hw/arm/sbsa-ref: Remove unnecessary check for secure_sysmem == NULL
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 8 Jul 2019 13:11:31 +0000 (14:11 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 8 Jul 2019 13:11:31 +0000 (14:11 +0100)
commitc8ead5712486edb5058475fdef2c616857f5056f
treea631a7aad871a7f3ca44fa8ad2ab2e056d19a874
parent2785f196318c759d2ba97a36c168e848ec38d362
hw/arm/sbsa-ref: Remove unnecessary check for secure_sysmem == NULL

In the virt machine, we support TrustZone being either present or
absent, and so the code must deal with the secure_sysmem pointer
possibly being NULL. In the sbsa-ref machine, TrustZone is always
present, but some code and comments copied from virt still treat
it as possibly not being present.

This causes Coverity to complain (CID 1407287) that we check
secure_sysmem for being NULL after an unconditional dereference.
Simplify the code so that instead of initializing the variable
to NULL, unconditionally assigning it, and then testing it for NULL,
we just initialize it correctly in the variable declaration and
then assume it to be non-NULL. We also delete a comment which
only applied to the non-TrustZone config.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20190704142004.7150-1-peter.maydell@linaro.org
Tested-by: Radosław Biernacki <radoslaw.biernacki@linaro.org>
Reviewed-by: Radosław Biernacki <radoslaw.biernacki@linaro.org>
hw/arm/sbsa-ref.c