]> xenbits.xensource.com Git - qemu-xen.git/commit
hw/display/bcm2835_fb.c: Initialize all fields of struct
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 3 Jul 2020 15:59:43 +0000 (16:59 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 3 Jul 2020 15:59:43 +0000 (16:59 +0100)
commite757db25aa3406e9098ae999a469d56c370f4447
tree26f734048874d4aa0d8477d4a00736b563206707
parent4b4dc9750a0aa0b9766bd755bf6512a84744ce8a
hw/display/bcm2835_fb.c: Initialize all fields of struct

In bcm2835_fb_mbox_push(), Coverity complains (CID 1429989) that we
pass a pointer to a local struct to another function without
initializing all its fields.  This is a real bug:
bcm2835_fb_reconfigure() copies the whole of our new BCM2385FBConfig
struct into s->config, so any fields we don't initialize will corrupt
the state of the device.

Copy the two fields which we don't want to update (pixo and alpha)
from the existing config so we don't accidentally change them.

Fixes: cfb7ba983857e40e88
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20200628195436.27582-1-peter.maydell@linaro.org
hw/display/bcm2835_fb.c