[PATCH 01/10] video: ipuv3: Do not crash when no mode is found

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 drivers/video/imx-ipu-v3/ipufb.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/video/imx-ipu-v3/ipufb.c b/drivers/video/imx-ipu-v3/ipufb.c
index ea2e83b..401f8f7 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);
-- 
2.5.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux