]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
MLK-10248 video: ipuv3-fb: fix hang up with cmdline option for CLAA WVGA
authorRobby Cai <r63905@freescale.com>
Sun, 15 Feb 2015 06:00:14 +0000 (14:00 +0800)
committerRobby Cai <r63905@freescale.com>
Sun, 15 Feb 2015 08:04:28 +0000 (16:04 +0800)
The kernel boot stops at "Starting kernel ..." if assign cmdline
"video=mxcfb0:dev=lcd,if=RGB565".

The cause is that there's no 'mode_str' property for mxcfb0 in DTS file,
so of_property_read_string() does not touch it and 'mode_str' could be used
uninitialized in mxcfb_get_of_property(), where it's assigned to
plat_data->mode_str and then used uninitialized in fb_find_mode().
This may cause buffer overflow. This patch initializes 'mode_str' to NULL
to fix it.

Signed-off-by: Robby Cai <r63905@freescale.com>
(cherry picked from commit 115d11804b7b56d058ee6be8496b13f57869be93)

drivers/video/mxc/mxc_ipuv3_fb.c

index 9d074f9e7a800c11d461565d4f721a170a71a469..1fbfc9dd980aecc8432da3bca1f9737bd0740c44 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2014 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2004-2015 Freescale Semiconductor, Inc. All Rights Reserved.
  */
 
 /*
@@ -2275,7 +2275,7 @@ static int mxcfb_get_of_property(struct platform_device *pdev,
 {
        struct device_node *np = pdev->dev.of_node;
        const char *disp_dev;
-       const char *mode_str;
+       const char *mode_str = NULL;
        const char *pixfmt;
        int err;
        int len;