diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2010-06-30 09:26:35 (GMT) |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-08-04 07:03:02 (GMT) |
commit | dba6f385b83d7f19eb1d4df12f422bab945c7f10 (patch) | |
tree | 90dd9b477986bc568bc4445c7fbb0c9409a89451 /drivers/video/sh_mobile_lcdcfb.c | |
parent | 8a2b6beffc88b83089845d72eed2ed74eb5c9b1e (diff) | |
download | linux-fsl-qoriq-dba6f385b83d7f19eb1d4df12f422bab945c7f10.tar.xz |
fbdev: sh-mobile-lcdc: fix potential Oops in SH-Mobile LCDC framebuffer driver
sh_mobile_lcdc_setup_clocks() can perform IO, therefore it has to be called
after ioremap(). Also check return code of ioremap() and use resource_size()
instead of open-coding it.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video/sh_mobile_lcdcfb.c')
-rw-r--r-- | drivers/video/sh_mobile_lcdcfb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 12c451a..0c97509 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -1020,14 +1020,16 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) goto err1; } + priv->base = ioremap_nocache(res->start, resource_size(res)); + if (!priv->base) + goto err1; + error = sh_mobile_lcdc_setup_clocks(pdev, pdata->clock_source, priv); if (error) { dev_err(&pdev->dev, "unable to setup clocks\n"); goto err1; } - priv->base = ioremap_nocache(res->start, (res->end - res->start) + 1); - for (i = 0; i < j; i++) { cfg = &priv->ch[i].cfg; |