summaryrefslogtreecommitdiff
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:02:46 +0800
commit2d16313abad65330cb03d365d307f2d0caafe955 (patch)
tree0adbb665cb00f91493b880e0fedab1610b01f02b
parentb29df373e547c83f9b3bcfd9a98016f462fa9ec2 (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>
-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 65e3f5f61157..8c45a534cbfb 100644
--- a/drivers/video/mxc/mxc_ipuv3_fb.c
+++ b/drivers/video/mxc/mxc_ipuv3_fb.c
@@ -1957,7 +1957,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(
@@ -2050,7 +2050,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);