diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-09-22 09:05:57 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-10-01 08:26:07 +0200 |
commit | e8e387731b46cc0c22ef40c9247a43a71e556802 (patch) | |
tree | 6ea8df16ffa2358486162e2278f273a327df7806 /drivers/video | |
parent | 4a1379886fd508db95e337f230fe3c1ec5c110d8 (diff) | |
download | barebox-e8e387731b46cc0c22ef40c9247a43a71e556802.tar.gz barebox-e8e387731b46cc0c22ef40c9247a43a71e556802.tar.xz |
video: ipuv3: Do not crash when no mode is found
When something is missing in the device tree or not all necessary
drivers are compiled in it may happen that no valid mode is found.
Do not crash in this case but print an error message.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/imx-ipu-v3/ipufb.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/video/imx-ipu-v3/ipufb.c b/drivers/video/imx-ipu-v3/ipufb.c index ea2e83b7f0..401f8f728b 100644 --- a/drivers/video/imx-ipu-v3/ipufb.c +++ b/drivers/video/imx-ipu-v3/ipufb.c @@ -189,6 +189,11 @@ static void ipufb_enable_controller(struct fb_info *info) { struct ipufb_info *fbi = container_of(info, struct ipufb_info, info); + if (!info->mode) { + dev_err(fbi->dev, "No valid mode found\n"); + return; + } + vpl_ioctl_prepare(&fbi->vpl, 2 + fbi->dino, info->mode); ipu_crtc_mode_set(fbi, info->mode, 0, 0); |