Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6014954ybc; Wed, 27 Nov 2019 13:25:50 -0800 (PST) X-Google-Smtp-Source: APXvYqxMKIoXkXTF3Vn2sHUjWPZ0w8H1ysAomdbOmGI6ExRzXChd8lYrPWcUfXSUJegj+CMNGMRK X-Received: by 2002:a17:906:d052:: with SMTP id bo18mr52171655ejb.128.1574889950232; Wed, 27 Nov 2019 13:25:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574889950; cv=none; d=google.com; s=arc-20160816; b=PeOy+VQS7h+WYKICh4hknAcesRkRP/dw+/spO8JLMKNHCoer4eGHe/aArUUfvIJv/M fs/TDG4SfB5Vd+vp/onJJLv8fDgy64wPEoQJyQmzs+t8wm8jy9IXzWvkb1F+NV1VnQL3 1VccwyBxzWfy3QCmtvgC8r0jp+Ai7t8AGeLSER6xcsCAJQhu8+fmsYvwC4J/WKGjLb2U 2cf5efmJsdvjWaVf7lgsdUOfp7lm8YWc7W7kJUVMc3pFiE+x5DJVO0UYlRFT7mj3wR+D yIu7z0f6pmYRYUHnAPXRSt9cKtbif6GnB0ryEb83BhDXy8/xbthteyy2owR2aEYFzYFP rYQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gpTaLUo9WQ/4LS5/pR6fcjMECHXv3fnjDbpXYCggumA=; b=QzXdkPwq8FBFEA1yT0qUJ4JOR1jV5ZWcC6a918L/Xe1g/AfC45VqjHN2QNdbkxucQN f5/56OAmqFmhipRaSXWUdA71+yyqKWv6R7bvRt47nYT8LuHQQ6gcGcaNe9AXwHwdNVn8 uWrERDViwF+teINH8vcM+UPRTH8wavw1MKgQs6ZLCICKczWwSU2Ba8kh7VKWWiUsVVae 7H+rtTxitzji0EmuJHdZiyCz/4JYF78+Xv1nM7/8eh9p9spvn8FBG3BoUsn61j/iWPcw amN03Mvkj/8fsTU+A9cVW2OLRND1k1Clph0v5XpVmxzcSAcSSVMc6NuGeOtUUtSEXI18 L7sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iytbX7TJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l26si13354311edt.143.2019.11.27.13.25.27; Wed, 27 Nov 2019 13:25:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iytbX7TJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732205AbfK0VEw (ORCPT + 99 others); Wed, 27 Nov 2019 16:04:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:58344 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732193AbfK0VEr (ORCPT ); Wed, 27 Nov 2019 16:04:47 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 17D202080F; Wed, 27 Nov 2019 21:04:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888686; bh=Fi8OaMcX8gTmZH11iXnGBBrdgRkl0FBxFfRS9Yc16JI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iytbX7TJynR0HrujxjFu3oNHnCdkpGansHbId0CcDZPkpkCVZ/yZyuverc/B+Wxdm SK4BuTBqqWxKAX+Id8xAy1xyWuFritsE1hcl6nYoIJ+HG6Ed3lhVPuGpTKBCdk9t2z wk0g6x44gr48l1tU4/5IRfIA3oas8wd53+hHb64k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shivasharan S , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.19 228/306] scsi: megaraid_sas: Fix goto labels in error handling Date: Wed, 27 Nov 2019 21:31:18 +0100 Message-Id: <20191127203131.685112861@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shivasharan S [ Upstream commit 8a25fa17b6ed6e6c8101e9c68a10ae68a9025f2c ] 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 Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- 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 2f94ab9c23540..2f31d266339f8 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -5410,7 +5410,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); @@ -5619,9 +5619,8 @@ static int megasas_init_fw(struct megasas_instance *instance) 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; -- 2.20.1