summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorCristina Ciocan <cristina-mihaela.ciocan@nxp.com>2017-02-03 19:32:44 +0200
committerAnson Huang <Anson.Huang@nxp.com>2017-06-08 20:59:51 +0800
commit2abead5364517f7aba2c87ecd00f0a7167918d90 (patch)
tree794564c458403ae9d845d682df3393928ecc27e2 /drivers/video
parentaaf584d4133e609d73a2947ec0550000bbd2a739 (diff)
MLK-13839 fbdev: mxsfb: Fix null pointer dereference
In function mxsfb_check_var an explicit null pointer dereference occurs when input frame is 32 bpp (var->bits_per_pixel) and the output frame is different from 8/16/18/24 (host->ld_intf_width). Even though a 32bpp output is possible under certain conditions, this is currently not implemented, so any other output bpp value is not valid. Signed-off-by: Cristina Ciocan <cristina-mihaela.ciocan@nxp.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/mxsfb.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c
index 1b3be43793e6..e0a1199a21f7 100644
--- a/drivers/video/fbdev/mxsfb.c
+++ b/drivers/video/fbdev/mxsfb.c
@@ -4,6 +4,7 @@
* This code is based on:
* Author: Vitaly Wool <vital@embeddedalley.com>
*
+ * Copyright 2017 NXP
* Copyright 2008-2015 Freescale Semiconductor, Inc. All Rights Reserved.
* Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
*
@@ -633,6 +634,15 @@ static int mxsfb_check_var(struct fb_var_screeninfo *var,
/* real 24 bit */
rgb = def_rgb888;
break;
+ default:
+ /*
+ * 32-bit output is possible through I/O muxing, if this
+ * option is available on chip. Currently not
+ * implemented.
+ */
+ pr_debug("Currently unsupported output colour depth: %u\n",
+ host->ld_intf_width);
+ return -EINVAL;
}
break;
default: