Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1311279 > unrolled thread

[PATCH 3.2 03/70] video: fbdev: fsl: Fix kernel crash when diu_ops is not implemented

Started byBen Hutchings <ben@decadent.org.uk>
First post2016-01-18 04:40 +0100
Last post2016-01-18 04:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.2 03/70] video: fbdev: fsl: Fix kernel crash when  diu_ops is not implemented Ben Hutchings <ben@decadent.org.uk> - 2016-01-18 04:40 +0100

#1311279 — [PATCH 3.2 03/70] video: fbdev: fsl: Fix kernel crash when diu_ops is not implemented

FromBen Hutchings <ben@decadent.org.uk>
Date2016-01-18 04:40 +0100
Subject[PATCH 3.2 03/70] video: fbdev: fsl: Fix kernel crash when diu_ops is not implemented
Message-ID<qS8PF-3ml-45@gated-at.bofh.it>
3.2.76-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Wang Dongsheng <dongsheng.wang@freescale.com>

commit acfc1cc13fe5bc6d7a10afa624f1e560850ddad3 upstream.

If diu_ops is not implemented on platform, kernel will access a NULL
pointer. We need to check this pointer in DIU initialization.

Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
Acked-by: Timur Tabi <timur@tabi.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/video/fbdev/fsl-diu-fb.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -446,7 +446,10 @@ static enum fsl_diu_monitor_port fsl_diu
 			port = FSL_DIU_PORT_DLVDS;
 	}
 
-	return diu_ops.valid_monitor_port(port);
+	if (diu_ops.valid_monitor_port)
+		port = diu_ops.valid_monitor_port(port);
+
+	return port;
 }
 
 /**
@@ -1759,6 +1762,14 @@ static int __init fsl_diu_init(void)
 #else
 	monitor_port = fsl_diu_name_to_port(monitor_string);
 #endif
+
+	/*
+	 * Must to verify set_pixel_clock. If not implement on platform,
+	 * then that means that there is no platform support for the DIU.
+	 */
+	if (!diu_ops.set_pixel_clock)
+		return -ENODEV;
+
 	pr_info("Freescale Display Interface Unit (DIU) framebuffer driver\n");
 
 #ifdef CONFIG_NOT_COHERENT_CACHE

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web