From patchwork Sun Oct 29 20:11:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10031639 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 805F9600C5 for ; Sun, 29 Oct 2017 20:12:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7297528754 for ; Sun, 29 Oct 2017 20:12:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 659FF28756; Sun, 29 Oct 2017 20:12:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2945B28754 for ; Sun, 29 Oct 2017 20:12:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751942AbdJ2UMA (ORCPT ); Sun, 29 Oct 2017 16:12:00 -0400 Received: from mout.web.de ([212.227.15.3]:61202 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751665AbdJ2UL6 (ORCPT ); Sun, 29 Oct 2017 16:11:58 -0400 Received: from [192.168.1.2] ([78.49.32.239]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MhlT9-1dmgDF2xIR-00Mtgk; Sun, 29 Oct 2017 21:11:42 +0100 Subject: [PATCH 1/5] wlcore: Use common error handling code in wlcore_nvs_cb() From: SF Markus Elfring To: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Arend Van Spriel , Eyal Reizer , Iain Hunter , James Minor , Johannes Berg , Kalle Valo , Maxim Altshul , Pieter-Paul Giesberts Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <7b40d50f-cdac-bd47-5070-894140f7ceb3@users.sourceforge.net> Date: Sun, 29 Oct 2017 21:11:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:39AdFyWbl3tyY8RYhnOFlt4WQdowLNp+oUPBA7R50uNKaegbBit DwrbDazXw8A2Tq+d2WDEZpwpg5NP1mdYSqLZCeGq0Z6Zse/RxpSE3uJ2HuZ5GO0PTnvDWOA y8Qfl6jkIQQnsaIOIhSeWdtIxoDSYxoBCUvFLsNx4Q658KMwB0af2ljyJKE4xckp4rGOUEK y1BLuxOUOLtdbNH321FMA== X-UI-Out-Filterresults: notjunk:1; V01:K0:F+YJlISrONM=:9kHZFtg6qiPgQ05UfqQuUX vt91Aduln1Q8a5Apd8FWSBXBkTsj7sd0Gh/IrspVt3M8lgZK8IujoJbVRSrdI3jO4D4DzRO3l lc8WMdcg478u1k3vw/hw9QoyzAHN5CLEI+429AM6TVDPU1+P4LIUnQK2G6n8n53dxmsFZIYwc YBRx/oTGVnaSqEqA7E8Tv8sM7+3S++bqSErnuB98Js9vDYfq76aSBIZ27zmU3Z5JfFLYUZMvQ tcpAcLU9LzxVliw/vpmux11xs/mWmFYHLz5jqtuSZ2FT6/KAFPNko4sN7cDP2ToZKzsnzQbO3 qYMSYbNRZo1o5lxzhq7SsQAOx0ODncDWP88weaiXu/Dp+7+ybvvxmmQ5qwA9ciFZTO/S6L8wF 8q1yc/42SS4YQVH+v78R67NfWo71QKJJvIpU/SNswfyKCEbpBOjlPJHZbLkpJr2HO6hsfaxSF qt7lY5Rgh0lHLOZTAJTV0uKOyYLtxOd3/8z/8OFMC584jCKboXKYS2D5HvGgaXgbDj9+nDt3q VPPcsdHEykjRZH6CdtyEym+unzvdYwGNSbGrs8GLwMPAMpgEbEGw6zfYT4NlsM0YKkGLC5J3Y Q/a+IRxTYZro3OpZjkHQAqC/pKOTrjyctwIvlEShqr5RtwnG8Fvza6LvYuIrNvkq7U/mpfXZy k76ovdBQME//lHNAHTd1XApg+sd+Zq7yg0M2G6YvkQ1XvtBW4cUCUAOwpzR2LAdOPKV/F4ikH oRnwOBxtxZUGAaNR+2JGP2B9ZjXVP72ATHQalodilOqx17NWoaOUiurL+3Y1XAOJGaQZiAYh0 fJZwGf9LyoVw/xMttS4YFRn1vQodJS0AkcADhtyQK3nOE3/8oM= Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 29 Oct 2017 18:38:04 +0100 Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/net/wireless/ti/wlcore/main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index c346c021b999..48380d48ef09 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -6496,16 +6496,14 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context) ret = wl12xx_get_hw_info(wl); if (ret < 0) { wl1271_error("couldn't get hw info"); - wl1271_power_off(wl); - goto out_free_nvs; + goto power_off; } ret = request_threaded_irq(wl->irq, hardirq_fn, wlcore_irq, wl->irq_flags, pdev->name, wl); if (ret < 0) { wl1271_error("interrupt configuration failed"); - wl1271_power_off(wl); - goto out_free_nvs; + goto power_off; } #ifdef CONFIG_PM @@ -6551,6 +6549,11 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context) out: release_firmware(fw); complete_all(&wl->nvs_loading_complete); + return; + +power_off: + wl1271_power_off(wl); + goto out_free_nvs; } int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev)