From patchwork Wed Jun 30 09:26:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 108779 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5U9RPJH008278 for ; Wed, 30 Jun 2010 09:27:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754844Ab0F3J0b (ORCPT ); Wed, 30 Jun 2010 05:26:31 -0400 Received: from mail.gmx.net ([213.165.64.20]:50480 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754810Ab0F3J03 (ORCPT ); Wed, 30 Jun 2010 05:26:29 -0400 Received: (qmail invoked by alias); 30 Jun 2010 09:26:27 -0000 Received: from p57BD1FAC.dip0.t-ipconnect.de (EHLO axis700.grange) [87.189.31.172] by mail.gmx.net (mp060) with SMTP; 30 Jun 2010 11:26:27 +0200 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX1/Hy4xFvhbHVxieKdpAjZzVcNTsw+BUuF+1gl+JDB Dm0urEaLeBCHZU Received: from lyakh (helo=localhost) by axis700.grange with local-esmtp (Exim 4.63) (envelope-from ) id 1OTtYx-0008SX-E4; Wed, 30 Jun 2010 11:26:35 +0200 Date: Wed, 30 Jun 2010 11:26:35 +0200 (CEST) From: Guennadi Liakhovetski To: "linux-sh@vger.kernel.org" cc: linux-fbdev@vger.kernel.org Subject: [PATCH] fbdev: sh-mobile-lcdc: fix potential Oops in SH-Mobile LCDC framebuffer driver Message-ID: MIME-Version: 1.0 X-Y-GMX-Trusted: 0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 30 Jun 2010 09:27:25 +0000 (UTC) diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index e8c7699..1ece226 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;