From patchwork Mon May 31 12:01:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 103267 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4VC1dJi022509 for ; Mon, 31 May 2010 12:01:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753541Ab0EaMBj (ORCPT ); Mon, 31 May 2010 08:01:39 -0400 Received: from mail-ew0-f216.google.com ([209.85.219.216]:61098 "EHLO mail-ew0-f216.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751691Ab0EaMBi (ORCPT ); Mon, 31 May 2010 08:01:38 -0400 Received: by ewy8 with SMTP id 8so941758ewy.28 for ; Mon, 31 May 2010 05:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=QmOF3KLCWXRMhFZ7zRpJ3AsIFwFtjOOh7eDBtshMEPI=; b=iFqtz2dTogS3ImrqyYy6BFzIT5A2lK0xhc7QMC+w1a3I1iDq1HMLKMgTYkSNzd90+Y WYtGP6SwGZ7aEHk7RZKLSzZNAd94o9Ta7JyCu6Hped2ZOWhWFuCmu0eu1dpkSr/5YMQn MakS8XDSsg6cya33t7LpPKQfHbNJiold5mXDA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=x1JoWhUgAo2mQA8lTvG4UMqXAxOagoI3WXL2km6sXifBKMGB2yWVRK96g1gjC36WFb YsSgZjr/qhMt00KtSHgj1KeMEGQoZf2SXHeVKmL3PW9i5nCHoFBFzqcXB4StMfxawdKz hZyc31wr1xrRltyprC/+BdWj4bHkbERwWn1zU= Received: by 10.213.34.140 with SMTP id l12mr5097457ebd.86.1275307295340; Mon, 31 May 2010 05:01:35 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id 15sm2985070ewy.8.2010.05.31.05.01.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 31 May 2010 05:01:34 -0700 (PDT) Date: Mon, 31 May 2010 14:01:22 +0200 From: Dan Carpenter To: Dmitry Torokhov Cc: Todd Fischer , Samuel Ortiz , linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch 1/2] input/tps6507x-ts: dereferencing before checking Message-ID: <20100531120122.GR5483@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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]); Mon, 31 May 2010 12:01:40 +0000 (UTC) diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c index 5de80a1..b99db09 100644 --- a/drivers/input/touchscreen/tps6507x-ts.c +++ b/drivers/input/touchscreen/tps6507x-ts.c @@ -355,10 +355,11 @@ static int __devexit tps6507x_ts_remove(struct platform_device *pdev) { struct tps6507x_dev *tps6507x_dev = platform_get_drvdata(pdev); struct tps6507x_ts *tsc = tps6507x_dev->ts; - struct input_dev *input_dev = tsc->input_dev; + struct input_dev *input_dev; if (!tsc) return 0; + input_dev = tsc->input_dev; cancel_delayed_work(&tsc->work); flush_workqueue(tsc->wq);