From patchwork Fri Jul 23 13:52:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Cox X-Patchwork-Id: 113897 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 o6NEP06O018637 for ; Fri, 23 Jul 2010 14:25:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757674Ab0GWOYk (ORCPT ); Fri, 23 Jul 2010 10:24:40 -0400 Received: from mga14.intel.com ([143.182.124.37]:34234 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752644Ab0GWOYj (ORCPT ); Fri, 23 Jul 2010 10:24:39 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 23 Jul 2010 07:24:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.55,247,1278313200"; d="scan'208";a="303582893" Received: from unknown (HELO localhost.localdomain) ([10.255.13.60]) by azsmga001.ch.intel.com with ESMTP; 23 Jul 2010 07:24:36 -0700 From: Alan Cox Subject: [PATCH 3/6] mrst-touchscreen: Fix use before initialize in mrst_touch [Fix bug 2561] To: greg@kroah.com, linux-input@vger.kernel.org, dmitry.torokhov@gmail.com Date: Fri, 23 Jul 2010 14:52:12 +0100 Message-ID: <20100723135210.19151.19238.stgit@localhost.localdomain> In-Reply-To: <20100723134852.19151.6999.stgit@localhost.localdomain> References: <20100723134852.19151.6999.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@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]); Fri, 23 Jul 2010 14:25:01 +0000 (UTC) --- linux-2.6.34/drivers/staging/mrst-touchscreen/intel-mid-touch.c~ 2010-06-23 03:13:39.000000000 +0000 +++ linux-2.6.34/drivers/staging/mrst-touchscreen/intel-mid-touch.c 2010-06-23 03:14:47.736742734 +0000 @@ -759,6 +759,8 @@ tsdev->irq = myirq; mrstouchdevp = tsdev; + tsdev->spi = mrstouch_spi; + err = mrstouch_adc_init(tsdev); if (err) { dev_err(&mrstouch_spi->dev, "ADC init failed\n"); @@ -766,7 +768,6 @@ } dev_set_drvdata(&mrstouch_spi->dev, tsdev); - tsdev->spi = mrstouch_spi; err = ts_input_dev_init(tsdev, mrstouch_spi); if (err) { --------------030606040305060606070104-- --- drivers/staging/mrst-touchscreen/intel-mid-touch.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/staging/mrst-touchscreen/intel-mid-touch.c b/drivers/staging/mrst-touchscreen/intel-mid-touch.c index 7e77737..c41989b 100644 --- a/drivers/staging/mrst-touchscreen/intel-mid-touch.c +++ b/drivers/staging/mrst-touchscreen/intel-mid-touch.c @@ -651,6 +651,8 @@ static int __devinit mrstouch_probe(struct spi_device *spi) snprintf(tsdev->phys, sizeof(tsdev->phys), "%s/input0", dev_name(&spi->dev)); + tsdev->spi = mrstouch_spi; + err = mrstouch_adc_init(tsdev); if (err) { dev_err(&spi->dev, "ADC initialization failed\n");