From patchwork Mon Nov 2 08:53:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Naik X-Patchwork-Id: 56949 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA28tCW8029446 for ; Mon, 2 Nov 2009 08:55:14 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id nA28rM1S014705 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 2 Nov 2009 02:53:22 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id nA28rLlv005299; Mon, 2 Nov 2009 02:53:21 -0600 (CST) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 18A3580627; Mon, 2 Nov 2009 02:53:21 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 7961C80626 for ; Mon, 2 Nov 2009 02:53:19 -0600 (CST) Received: from neches.ext.ti.com (localhost [127.0.0.1]) by dflp51.itg.ti.com (8.13.7/8.13.7) with ESMTP id nA28rJ0E018055 for ; Mon, 2 Nov 2009 02:53:19 -0600 (CST) Received: from mail110-va3-R.bigfish.com (mail-va3.bigfish.com [216.32.180.113]) by neches.ext.ti.com (8.13.7/8.13.7) with ESMTP id nA28rIES026695 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Mon, 2 Nov 2009 02:53:19 -0600 Received: from mail110-va3 (localhost.localdomain [127.0.0.1]) by mail110-va3-R.bigfish.com (Postfix) with ESMTP id 69BC21201F7 for ; Mon, 2 Nov 2009 08:53:18 +0000 (UTC) X-SpamScore: -11 X-BigFish: vps-11(zzzza48T1202hzzz2dh6bh2f6i61h) X-Spam-TCS-SCL: 0:0 X-MS-Exchange-Organization-Antispam-Report: OrigIP: 209.85.211.176; Service: EHS Received: by mail110-va3 (MessageSwitch) id 1257151997821822_7528; Mon, 2 Nov 2009 08:53:17 +0000 (UCT) Received: from VA3EHSMHS014.bigfish.com (unknown [10.7.14.245]) by mail110-va3.bigfish.com (Postfix) with ESMTP id C06CF1D0052 for ; Mon, 2 Nov 2009 08:53:17 +0000 (UTC) Received: from mail-yw0-f176.google.com (209.85.211.176) by VA3EHSMHS014.bigfish.com (10.7.99.24) with Microsoft SMTP Server id 14.0.482.32; Mon, 2 Nov 2009 08:53:16 +0000 Received: by ywh6 with SMTP id 6so4284776ywh.4 for ; Mon, 02 Nov 2009 00:53:16 -0800 (PST) Received: by 10.91.105.3 with SMTP id h3mr8471958agm.6.1257151996311; Mon, 02 Nov 2009 00:53:16 -0800 (PST) Received: from localhost.localdomain ([122.172.58.209]) by mx.google.com with ESMTPS id 36sm2465319yxh.31.2009.11.02.00.53.13 (version=SSLv3 cipher=RC4-MD5); Mon, 02 Nov 2009 00:53:15 -0800 (PST) From: Sameer Naik To: davinci-linux-open-source@linux.davincidsp.com Date: Mon, 2 Nov 2009 14:23:09 +0530 Message-ID: <1257151989-17525-1-git-send-email-sameer.subscriptions@damagehead.com> X-Mailer: git-send-email 1.6.2.5 In-Reply-To: References: MIME-Version: 1.0 X-Reverse-DNS: mail-yw0-f176.google.com Cc: Subject: [PATCH] FB: Davinci: Fix illegal data access in davincifb driver X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com diff --git a/drivers/video/davincifb.c b/drivers/video/davincifb.c index 1344be7..e890cbf 100644 --- a/drivers/video/davincifb.c +++ b/drivers/video/davincifb.c @@ -295,20 +295,24 @@ static irqreturn_t davincifb_isr(int irq, void *arg) unsigned long addr=0; if ((dispc_reg_in(VENC_VSTAT) & 0x00000010) == 0x10) { - xchg(&addr, dm->osd0->sdram_address); - if (addr) { - set_sdram_params(dm->osd0->info.fix.id, - dm->osd0->sdram_address, - dm->osd0->info.fix.line_length); - dm->osd0->sdram_address = 0; + if (dm->osd0) { + xchg(&addr, dm->osd0->sdram_address); + if (addr) { + set_sdram_params(dm->osd0->info.fix.id, + dm->osd0->sdram_address, + dm->osd0->info.fix.line_length); + dm->osd0->sdram_address = 0; + } } - addr = 0; - xchg(&addr, dm->osd1->sdram_address); - if (addr) { - set_sdram_params(dm->osd1->info.fix.id, - dm->osd1->sdram_address, - dm->osd1->info.fix.line_length); - dm->osd1->sdram_address = 0; + if (dm->osd1) { + addr = 0; + xchg(&addr, dm->osd1->sdram_address); + if (addr) { + set_sdram_params(dm->osd1->info.fix.id, + dm->osd1->sdram_address, + dm->osd1->info.fix.line_length); + dm->osd1->sdram_address = 0; + } } addr = 0; xchg(&addr, dm->vid0->sdram_address); @@ -318,13 +322,15 @@ static irqreturn_t davincifb_isr(int irq, void *arg) dm->vid0->info.fix.line_length); dm->vid0->sdram_address = 0; } - addr = 0; - xchg(&addr, dm->vid1->sdram_address); - if (addr) { - set_sdram_params(dm->vid1->info.fix.id, - dm->vid1->sdram_address, - dm->vid1->info.fix.line_length); - dm->vid1->sdram_address = 0; + if (dm->vid1) { + addr = 0; + xchg(&addr, dm->vid1->sdram_address); + if (addr) { + set_sdram_params(dm->vid1->info.fix.id, + dm->vid1->sdram_address, + dm->vid1->info.fix.line_length); + dm->vid1->sdram_address = 0; + } } return IRQ_HANDLED; } else {