From patchwork Thu Nov 24 16:10:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 698921 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3tPkhd1X8vz9t2T for ; Fri, 25 Nov 2016 03:10:57 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757147AbcKXQKY (ORCPT ); Thu, 24 Nov 2016 11:10:24 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:37647 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752856AbcKXQKW (ORCPT ); Thu, 24 Nov 2016 11:10:22 -0500 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1c9wYe-0007dN-DY; Thu, 24 Nov 2016 17:07:32 +0100 Date: Thu, 24 Nov 2016 17:10:13 +0100 From: Sebastian Andrzej Siewior To: Ursula Braun , tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, rt@linutronix.de, "David S. Miller" , linux-s390@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH] net/iucv: use explicit clean up labels in iucv_init() Message-ID: <20161124161013.dukr42y2nwscosk6@linutronix.de> References: <20161117183541.8588-1-bigeasy@linutronix.de> <20161117183541.8588-13-bigeasy@linutronix.de> <62f8abea-093c-cac5-ffb1-7b8710aa0a91@linux.vnet.ibm.com> <20161124091046.hixy3j4ibt7xzezr@linutronix.de> <20161124141415.llqki5vo7nqdusqv@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20161124141415.llqki5vo7nqdusqv@linutronix.de> User-Agent: NeoMutt/20161104 (1.7.1) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Ursula suggested to use explicit labels for clean up in the error path instead of one `out_free' label which handles multiple exits. Since the previous patch got already applied, here is a follow up patch. Signed-off-by: Sebastian Andrzej Siewior --- net/iucv/iucv.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c index f0d6afc5d4a9..8f7ef167c45a 100644 --- a/net/iucv/iucv.c +++ b/net/iucv/iucv.c @@ -2038,16 +2038,16 @@ static int __init iucv_init(void) rc = cpuhp_setup_state(CPUHP_NET_IUCV_PREPARE, "net/iucv:prepare", iucv_cpu_prepare, iucv_cpu_dead); if (rc) - goto out_free; + goto out_dev; rc = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "net/iucv:online", iucv_cpu_online, iucv_cpu_down_prep); if (rc < 0) - goto out_free; + goto out_prep; iucv_online = rc; rc = register_reboot_notifier(&iucv_reboot_notifier); if (rc) - goto out_free; + goto out_remove_hp; ASCEBC(iucv_error_no_listener, 16); ASCEBC(iucv_error_no_memory, 16); ASCEBC(iucv_error_pathid, 16); @@ -2061,11 +2061,11 @@ static int __init iucv_init(void) out_reboot: unregister_reboot_notifier(&iucv_reboot_notifier); -out_free: - if (iucv_online) - cpuhp_remove_state(iucv_online); +out_remove_hp: + cpuhp_remove_state(iucv_online); +out_prep: cpuhp_remove_state(CPUHP_NET_IUCV_PREPARE); - +out_dev: root_device_unregister(iucv_root); out_int: unregister_external_irq(EXT_IRQ_IUCV, iucv_external_interrupt);