summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorLiu Ying <Ying.Liu@freescale.com>2012-02-23 13:51:03 +0800
committerLiu Ying <Ying.Liu@freescale.com>2012-02-23 14:38:20 +0800
commit4180f1cfce522201db868eec8c6c459d12a0e34d (patch)
treedf96f663225e629dda213d65538694fca18ae61b /drivers/video
parente2207c48a8d77d09014ca57c733aea36b1db37ec (diff)
ENGR00175222-2 IPUv3 fb:Check mem resource start address
This patch checks memory resource start address before using the memory resource. Signed-off-by: Liu Ying <Ying.Liu@freescale.com> (cherry picked from commit 2d16313abad65330cb03d365d307f2d0caafe955)
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/mxc/mxc_ipuv3_fb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/mxc/mxc_ipuv3_fb.c b/drivers/video/mxc/mxc_ipuv3_fb.c
index 97238d82742b..6434d82d0941 100644
--- a/drivers/video/mxc/mxc_ipuv3_fb.c
+++ b/drivers/video/mxc/mxc_ipuv3_fb.c
@@ -1956,7 +1956,7 @@ static int mxcfb_setup_overlay(struct platform_device *pdev,
ovfbi->var.xres = 240;
ovfbi->var.yres = 320;
- if (res && res->end) {
+ if (res && res->start && res->end) {
ovfbi->fix.smem_len = res->end - res->start + 1;
ovfbi->fix.smem_start = res->start;
ovfbi->screen_base = ioremap(
@@ -2048,7 +2048,7 @@ static int mxcfb_probe(struct platform_device *pdev)
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (res && res->end) {
+ if (res && res->start && res->end) {
fbi->fix.smem_len = res->end - res->start + 1;
fbi->fix.smem_start = res->start;
fbi->screen_base = ioremap(fbi->fix.smem_start, fbi->fix.smem_len);