From patchwork Thu Sep 1 22:04:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 1120802 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p81MUALE003338 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 1 Sep 2011 22:30:31 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QzFlx-0007nF-TC; Thu, 01 Sep 2011 22:30:09 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QzFlw-0007mh-PG for spi-devel-general@lists.sourceforge.net; Thu, 01 Sep 2011 22:30:08 +0000 Received-SPF: fail (sog-mx-2.v43.ch3.sourceforge.com: domain of nvidia.com does not designate 70.85.31.133 as permitted sender) client-ip=70.85.31.133; envelope-from=swarren@nvidia.com; helo=avon.wwwdotorg.org; Received: from avon.wwwdotorg.org ([70.85.31.133]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1QzFlu-0007U3-Ia for spi-devel-general@lists.sourceforge.net; Thu, 01 Sep 2011 22:30:08 +0000 Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id CC441641E; Thu, 1 Sep 2011 16:07:12 -0600 (MDT) Received: from localhost.localdomain (searspoint.nvidia.com [216.228.112.21]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id 27EB1E4780; Thu, 1 Sep 2011 16:05:05 -0600 (MDT) From: Stephen Warren To: Greg Kroah-Hartman , Jean Delvare , Ben Dooks , Jonathan Cameron , Grant Likely , Arnd Bergmann Subject: [PATCH V3 5/5] staging:iio:magnetometer:ak8975: Fix probe() error-handling Date: Thu, 1 Sep 2011 16:04:36 -0600 Message-Id: <1314914676-28397-10-git-send-email-swarren@nvidia.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1314914676-28397-1-git-send-email-swarren@nvidia.com> References: <1314914676-28397-1-git-send-email-swarren@nvidia.com> X-Virus-Scanned: clamav-milter 0.96.5 at avon.wwwdotorg.org X-Virus-Status: Clean X-Spam-Score: 4.1 (++++) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 4.0 SPF_CHECK_FAIL SPF reports sender host as NOT permitted to send mails from 0.9 SPF_FAIL SPF: sender does not match SPF record (fail) -0.8 AWL AWL: From: address is in the auto white-list X-Headers-End: 1QzFlu-0007U3-Ia Cc: devel@driverdev.osuosl.org, Andrew Chew , Stephen Warren , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Cameron , spi-devel-general@lists.sourceforge.net, linux-tegra@vger.kernel.org, Russell King , linux-i2c@vger.kernel.org X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 01 Sep 2011 22:30:32 +0000 (UTC) Fix ak8975_probe() to jump to the appropriate exit labels when an error occurs. With the previous code, some cleanup actions were being skipped for some error conditions. Signed-off-by: Stephen Warren --- drivers/staging/iio/magnetometer/ak8975.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/iio/magnetometer/ak8975.c b/drivers/staging/iio/magnetometer/ak8975.c index 0dfdf50..cc20e8d 100644 --- a/drivers/staging/iio/magnetometer/ak8975.c +++ b/drivers/staging/iio/magnetometer/ak8975.c @@ -510,7 +510,7 @@ static int ak8975_probe(struct i2c_client *client, err = ak8975_setup(client); if (err < 0) { dev_err(&client->dev, "AK8975 initialization fails\n"); - goto exit_gpio; + goto exit_free_iio; } i2c_set_clientdata(client, indio_dev);