aboutsummaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorFabian Vogt <fvogt@suse.com>2019-07-11 16:56:24 +0200
committerAnatolij Gustschin <agust@denx.de>2019-07-29 10:14:04 +0200
commit970baf16d1322d3930a57fc78ddfb15d594d690c (patch)
tree52e322c86dc0a395ef5168a3a9ba33487fe2906c /drivers/video
parent60a62acfb07afb0815f28abe6f49a9b906a7c3f4 (diff)
downloadu-boot-970baf16d1322d3930a57fc78ddfb15d594d690c.zip
u-boot-970baf16d1322d3930a57fc78ddfb15d594d690c.tar.gz
u-boot-970baf16d1322d3930a57fc78ddfb15d594d690c.tar.bz2
video: arm: rpi: Bail out early if querying video information fails
When probing we query for the width and hight of the display. If the firmware does not report any connected display the system will crash. See https://github.com/raspberrypi/firmware/issues/1157 for details. Signed-off-by: Fabian Vogt <fvogt@suse.com> [mb: update commit message] Signed-off-by: Matthias Brugger <mbrugger@suse.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Tested-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/bcm2835.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/bcm2835.c b/drivers/video/bcm2835.c
index bc41090..1d2eda0 100644
--- a/drivers/video/bcm2835.c
+++ b/drivers/video/bcm2835.c
@@ -19,13 +19,15 @@ static int bcm2835_video_probe(struct udevice *dev)
debug("bcm2835: Query resolution...\n");
ret = bcm2835_get_video_size(&w, &h);
- if (ret)
+ if (ret || w == 0 || h == 0)
return -EIO;
debug("bcm2835: Setting up display for %d x %d\n", w, h);
ret = bcm2835_set_video_params(&w, &h, 32, BCM2835_MBOX_PIXEL_ORDER_RGB,
BCM2835_MBOX_ALPHA_MODE_IGNORED,
&fb_base, &fb_size, &pitch);
+ if (ret)
+ return -EIO;
debug("bcm2835: Final resolution is %d x %d\n", w, h);