From patchwork Wed Oct 17 06:37:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shivasharan Srikanteshwara X-Patchwork-Id: 10644649 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 AD6211508 for ; Wed, 17 Oct 2018 06:38:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DB3E2954F for ; Wed, 17 Oct 2018 06:38:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 924802957A; Wed, 17 Oct 2018 06:38:27 +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 3FEB62954F for ; Wed, 17 Oct 2018 06:38:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727259AbeJQOce (ORCPT ); Wed, 17 Oct 2018 10:32:34 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:33089 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727099AbeJQOce (ORCPT ); Wed, 17 Oct 2018 10:32:34 -0400 Received: by mail-pf1-f193.google.com with SMTP id 78-v6so10309964pfq.0 for ; Tue, 16 Oct 2018 23:38:26 -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=aBmggZW8wMNBpXGzgkhvu7yBWSdymA7yEr92Ds+MuHg=; b=Ta5TTHk3ZmRuaSodYufltmMoQqemq39cji6Bf6w2Qh0vg8qB3StheGav0QCwx5iKGR uKT7YQ7BA7EoxRWFK1vkZtWoJ3Ezt5uzkvuXK5ft3mPZ/HvbheDFwNPe6VXH/mAHWHZo 0Z1XPIqewLYSzW/N3bYp6cwMhXebElb4Gvx5A= 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=aBmggZW8wMNBpXGzgkhvu7yBWSdymA7yEr92Ds+MuHg=; b=nrFAlaDGIMdPYLbP83AvDnIsiE8XpzKoVgaQQRTRlggtZIlLIXniO5z3wbJwvihbvj FpXjpqk30oMfLzOeS3+0L/KqFPHZbUJmGZcGyCkBdJAZZaFMBg0BpP/QA9Qdi5mkt7zK VUDUpU61KLtbpr4bg4C5j1X6mnwYezLyniTNi59zAnwotS8u8k9Q4hZoMewIxp/CkXPx SscmjFJU9cmXIEfYO1jgUjG/No7kyc4FVKSd2sbjosFNE5QvGzE9Dn7a4w6fG8eoZUix biOUG516wnsfcO2GgJXFLi0kFAkpyY/+G4L3T+1PqYfqndEhruCB/CJ13pr8Yt2KtLPQ lFjg== X-Gm-Message-State: ABuFfojYoB2ObChSgBgHjvLEQiCcE23Yb+eh3djKOiMXQM4tlu5zl60k FQRMRUsWon2Bd8QneNOiPefMKeMgMeP7Ww== X-Google-Smtp-Source: ACcGV61he+VpY9BPyvgCY1hOnbrW0nNjW8Ky/lhRcOUasrQHa7KxIXZlw0CO6ZYi2PKYkxz7pp8ICw== X-Received: by 2002:a62:6a06:: with SMTP id f6-v6mr15882514pfc.31.1539758305648; Tue, 16 Oct 2018 23:38:25 -0700 (PDT) Received: from dhcp-135-24-192-142.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id y131-v6sm19375425pfg.164.2018.10.16.23.38.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Oct 2018 23:38:24 -0700 (PDT) From: Shivasharan S To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, Shivasharan S Subject: [PATCH V2 06/19] megaraid_sas: Fix goto labels in error handling Date: Tue, 16 Oct 2018 23:37:44 -0700 Message-Id: <1539758277-1882-7-git-send-email-shivasharan.srikanteshwara@broadcom.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1539758277-1882-1-git-send-email-shivasharan.srikanteshwara@broadcom.com> References: <1539758277-1882-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 4f4e59db8c56..63ea601e5638 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -5473,7 +5473,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); @@ -5698,9 +5698,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;