From patchwork Fri Oct 12 10:57:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shivasharan Srikanteshwara X-Patchwork-Id: 10638491 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 25267933 for ; Fri, 12 Oct 2018 10:58:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 144182A04D for ; Fri, 12 Oct 2018 10:58:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07E7E2B397; Fri, 12 Oct 2018 10:58:16 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 A3A6A2A04D for ; Fri, 12 Oct 2018 10:58:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728097AbeJLSaH (ORCPT ); Fri, 12 Oct 2018 14:30:07 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:40027 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727652AbeJLSaH (ORCPT ); Fri, 12 Oct 2018 14:30:07 -0400 Received: by mail-ed1-f67.google.com with SMTP id r1-v6so11099591edd.7 for ; Fri, 12 Oct 2018 03:58:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mwUgc7OdOjv6ZgYXqZtbP2ksVY6CCj5Ttp9ate2kMAo=; b=G8peHSFWKOYxXh8I1OhDr+l4ujVa2TNRauOF6/4XNxXY0+HM3fVY6SoWNZDwLTr7OD G+eOCForcFnDcGwTrpwSN8HLOKuuso9CyWVDT6j4eM6MyHoW/Nfc3y57QShh1bLp5CPw j12qquZKqigZNj69R6KsSAoYLFTaFdSB3pemY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mwUgc7OdOjv6ZgYXqZtbP2ksVY6CCj5Ttp9ate2kMAo=; b=YmJehWR4Dmq0DFsGJAfLHrZx14pF6tFE88vvmo28cPnbDbu6y6Ix8cIq1d0odka5mT 8wIBDPRn76BFRhUsnGrlRz3RcH4MtPIy3Ah9p4mNqt7/6cMpd/mQtRLkpCcvldebelYn kmElbYlyg5WNuEJuaMoTM7yvkIpK173S3pJnMJ4XRUOBcDsr6CFEO8YGoMjhUZPrPPCa SvrXRhpRXyaPd/5E3kGAJ6U07UT5CbArcMETyErZkvXqNMifUrcueh8PX2U5/DpIV4KU 60CM1JFiC56lRfNznL9LoaefaD/ptg8KOezRF2f7kZx6f5ifJUtRE9QiV/5JlnUNi6Tb Q2uA== X-Gm-Message-State: ABuFfoi23tKOjcZpSLahl6gf+V/MNPIDB3Q4YzgkUAKhZOGJu7AQWm/Y 9ZzfUCtmm7dSgWKFqf9ZEy1iUwFnEY3Wfg== X-Google-Smtp-Source: ACcGV62LAraDRjAclAt2RuNjdER8ya+ppCzL0/44hbY+3sNLb+BeGxTeKR5/QWVUyv+brxBhXDCykw== X-Received: by 2002:a17:906:3915:: with SMTP id f21-v6mr6436786eje.159.1539341893037; Fri, 12 Oct 2018 03:58:13 -0700 (PDT) Received: from dhcp-135-24-192-142.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id m25-v6sm451198edc.86.2018.10.12.03.58.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Oct 2018 03:58:12 -0700 (PDT) From: Shivasharan S To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, Shivasharan S Subject: [PATCH 06/19] megaraid_sas: Fix goto labels in error handling Date: Fri, 12 Oct 2018 03:57:20 -0700 Message-Id: <1539341853-26814-7-git-send-email-shivasharan.srikanteshwara@broadcom.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1539341853-26814-1-git-send-email-shivasharan.srikanteshwara@broadcom.com> References: <1539341853-26814-1-git-send-email-shivasharan.srikanteshwara@broadcom.com> 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 Fix - During init, if pci_alloc_irq_vectors() fails, the driver has not yet setup the IRQs. Fix the goto labels and error handling for this case. Signed-off-by: Shivasharan S --- drivers/scsi/megaraid/megaraid_sas_base.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 68c59c809cb7..05f6f7f74df5 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -5474,7 +5474,7 @@ static int megasas_init_fw(struct megasas_instance *instance) if (!instance->msix_vectors) { i = pci_alloc_irq_vectors(instance->pdev, 1, 1, PCI_IRQ_LEGACY); if (i < 0) - goto fail_setup_irqs; + goto fail_init_adapter; } megasas_setup_reply_map(instance); @@ -5699,9 +5699,8 @@ static int megasas_init_fw(struct megasas_instance *instance) del_timer_sync(&instance->sriov_heartbeat_timer); fail_get_ld_pd_list: instance->instancet->disable_intr(instance); -fail_init_adapter: megasas_destroy_irqs(instance); -fail_setup_irqs: +fail_init_adapter: if (instance->msix_vectors) pci_free_irq_vectors(instance->pdev); instance->msix_vectors = 0;