From patchwork Fri Jan 1 20:31:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 7940001 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BC0D6BEEE5 for ; Fri, 1 Jan 2016 20:31:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EAD7520501 for ; Fri, 1 Jan 2016 20:31:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16B86204FF for ; Fri, 1 Jan 2016 20:31:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752524AbcAAUbh (ORCPT ); Fri, 1 Jan 2016 15:31:37 -0500 Received: from mout.web.de ([212.227.17.12]:50717 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752331AbcAAUbf (ORCPT ); Fri, 1 Jan 2016 15:31:35 -0500 Received: from [192.168.1.2] ([77.182.63.9]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0MIeQO-1aHJHL29Wq-002GI4; Fri, 01 Jan 2016 21:31:27 +0100 Subject: [PATCH 2/3] net-iwlegacy: One check less in il_eeprom_init() after error detection To: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Kalle Valo , Stanislaw Gruszka References: <566ABCD9.1060404@users.sourceforge.net> <5686E13F.2010309@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <5686E21E.4090901@users.sourceforge.net> Date: Fri, 1 Jan 2016 21:31:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <5686E13F.2010309@users.sourceforge.net> X-Provags-ID: V03:K0:kV2rOppjz1D1XuzD6mwSm/TVFd1WmB7J/Yp6Rtap6WEsc940+r5 eztZm4jtzSW68is0lSd+zgZRxhnuLrQFWGQjzMa0+3oujI8jckj75zXJhN5Hrp4/1xLcLLi OYonYdicQFYwt22aATWKzxtN67H4+zFS+TCqm4KLyyVA1M0+4pGvOQUFWQxZqXfvLlkioWa wVtabPZwEV4Ez2gBRGJwA== X-UI-Out-Filterresults: notjunk:1; V01:K0:vgr617Fa2ik=:FqVvKH0oOyfkn9OBIukfjm a8FWMkhoGJ2suww7sAu+kHUx1liOXIOQYN8Akr6edeTOZMNvZ6+nYUINJ21FFq3IiPMkelZgm KeQiOBJUc2qGtRMLexYNdpc3Jf+LzE10KVk2l/36i4RMx30zygAWYatqCqFKwL0/Ft8pvNdJm m48SQi5dxL7JtJaqXMWnybaf0M7iOhv5VvBdvjPO72TUgveYICcFmdYNo/XFFr+YmJVyX67oA s2Oumzio6S7gCkQPMPw5Y2qPHr/mXVYMpWkekqLsRRD1PUwyHA/DTZmeNWZW9v7nvojCyeVFi K2jcXdzncAzCTfiAg6a2s34gEqFTurKZcxrMNxA5UMDw4U4P6uDnsH3Ucy7ff4cl8g+IYj9QM iOuk0D7g6lfVvy/vj2zyWyouniaL4xJx6hXH14TP+GkJ2IY0o85CBv59DXBMLIpfjEvTxwwYj lMgb6N5ezoJ0q8Jicf48p8L2puH3N7zslS8TrIJ322IvBPI1VzcB19nqCKzJuuTRyFseT5SEI 30Y2cbGM+O2Bo3EoHEjI0+jh+wOswyFrG5GWt5A0iiczQSgEkCLvpDIWGz2oRrgZHjSdOOw9f CmjtIoNMovNJn/F98+gg/PEFyWJ2S4Tm8bFZUa7ekaW4LH6WTtRECrmr1COZTHCXC1Q+zwU7I SssGudurWQEKXC7GzO7lrCUWq98vzqu7e6k6ZM1ZXTTnhfNzJq2jvWpYutZLKtZgyZXO0B0IG QlrkdJoTlCrKVCwuEeWyxgQi7k+M4SWYWoKvi0vD6ewyuEGo3gnoVC153XpQS9XqzL2R3OPqg AtOCsKT Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Fri, 1 Jan 2016 21:12:29 +0100 This issue was detected by using the Coccinelle software. Adjust a jump target to avoid a check repetition before the function call "il_eeprom_free". Signed-off-by: Markus Elfring --- drivers/net/wireless/intel/iwlegacy/common.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/intel/iwlegacy/common.c b/drivers/net/wireless/intel/iwlegacy/common.c index c3afaf7..ae45fd3 100644 --- a/drivers/net/wireless/intel/iwlegacy/common.c +++ b/drivers/net/wireless/intel/iwlegacy/common.c @@ -734,7 +734,7 @@ il_eeprom_init(struct il_priv *il) if (ret < 0) { IL_ERR("EEPROM not found, EEPROM_GP=0x%08x\n", gp); ret = -ENOENT; - goto err; + goto free_eeprom; } /* Make sure driver (instead of uCode) is allowed to read EEPROM */ @@ -742,7 +742,7 @@ il_eeprom_init(struct il_priv *il) if (ret < 0) { IL_ERR("Failed to acquire EEPROM semaphore.\n"); ret = -ENOENT; - goto err; + goto free_eeprom; } /* eeprom is an array of 16bit values */ @@ -772,9 +772,11 @@ il_eeprom_init(struct il_priv *il) done: il->ops->eeprom_release_semaphore(il); -err: - if (ret) + if (ret) { +free_eeprom: il_eeprom_free(il); + } + /* Reset chip to save power until we load uCode during "up". */ il_apm_stop(il); return ret;