From patchwork Fri Jun 2 12:39:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Milan P. Gandhi" X-Patchwork-Id: 9762447 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 2F490602F0 for ; Fri, 2 Jun 2017 12:39:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16B9C228C9 for ; Fri, 2 Jun 2017 12:39:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08A3826E4E; Fri, 2 Jun 2017 12:39: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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham 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 D625E228C9 for ; Fri, 2 Jun 2017 12:39:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751248AbdFBMjL (ORCPT ); Fri, 2 Jun 2017 08:39:11 -0400 Received: from mail-it0-f47.google.com ([209.85.214.47]:38891 "EHLO mail-it0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751130AbdFBMjK (ORCPT ); Fri, 2 Jun 2017 08:39:10 -0400 Received: by mail-it0-f47.google.com with SMTP id r63so18483813itc.1 for ; Fri, 02 Jun 2017 05:39:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:to:cc:from:subject:organization :message-id:date:user-agent:mime-version:content-transfer-encoding; bh=dW2YUQWqw8cmeizRMBvuLJv01HjbA9s9xXIZrG52Hek=; b=I3ONN0OzxrgDG2dYddFVtD2fyWHp1ddzaKKh9AW7hGnUc/pvHd6+LNmJdu2I5YWyzx l+ARoMZAuVwgWHvghvi6lqd1BXHq4jgmEdnSLmMC8qkngfKFAUyInFahutlgoAWifg6Z +YHYwqw+T9A3E476MlWqU66dzZ/H/IGrXG/aY+eTP5wJOPQc5Bv8vTsrG5jKRDJtDIxW sDih4P7SmMmyv7dn0ZVk2su9YkVQ3/Hv+lv8uK4THMm8fhzsFXYAUbJpYI3tnEW/S+ec SV/EQhtbDy348a5uRk9JzEBuMQp+n7J8JY3U3PVqJPEkRpNMqe2HZ4GaqxPdyICWjjti wz8A== X-Gm-Message-State: AODbwcAZ6MsAgN87ke+V3v+EEz00LgZSxawZRsD1eHfb5gMHIhQrQwxO JWi5vUSd7HIToOwMuMD2hHe/ X-Received: by 10.84.228.194 with SMTP id y2mr808296pli.13.1496407149470; Fri, 02 Jun 2017 05:39:09 -0700 (PDT) Received: from [10.76.1.230] ([125.16.97.127]) by smtp.gmail.com with ESMTPSA id p13sm45886311pfl.52.2017.06.02.05.39.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Jun 2017 05:39:08 -0700 (PDT) Reply-To: mgandhi@redhat.com To: Johannes Thumshirn , Julia Lawall , Dan Carpenter , Laurence Oberman , linux-scsi@vger.kernel.org Cc: kernel-janitors@vger.kernel.org From: "Milan P. Gandhi" Subject: [PATCH RESEND] Eliminate extra 'out_free' label from fcoe_init function Organization: Red Hat Message-ID: <8e1e75c4-3a80-00c3-2697-37fb1c86f7a1@redhat.com> Date: Fri, 2 Jun 2017 18:09:05 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Simplify the check for return code of fcoe_if_init routine in fcoe_init function such that we could eliminate need for extra 'out_free' label and duplicate mutex_unlock statement. Signed-off-by: Milan P. Gandhi --- drivers/scsi/fcoe/fcoe.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index ea21e7b..a2cf3d0 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -2523,14 +2523,13 @@ static int __init fcoe_init(void) fcoe_dev_setup(); rc = fcoe_if_init(); + mutex_unlock(&fcoe_config_mutex); + if (rc) - goto out_free; + goto out_destroy; - mutex_unlock(&fcoe_config_mutex); return 0; -out_free: - mutex_unlock(&fcoe_config_mutex); out_destroy: destroy_workqueue(fcoe_wq); return rc;