From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF54826982F; Tue, 8 Apr 2025 12:42:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744116121; cv=none; b=noGAPVICgyOEtCbACECl1WyUfJuruyten3x2rlstrpdM/lUu3iMU6EHqdu1/UFe6+olx1Rgrey7ZJujinZAUXftHNkA6wp8ucEQbxeAKA/QttI/HwfJwY5f5fFbnckZ+b23yEsgoRtxX00yasRy2xWXNnP/46skRjjNoTys5HI0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744116121; c=relaxed/simple; bh=TMkpjeZ7dMC/IVfzRg7CaMxvoF4FqLi41cWES71dy7M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nir7yc9RQjJleHwYafdhxocSiu1hiP/6zP43UeYFRLCds12t1b67wb9XpTIC9mozylGD2xawDMgCia4IoQyx126AO8jDs1GM05MzTbLIDbycoqYLTF/sEv89YMYKSVExLfG+f7X0WUz8iMWX0d02Aq/oPUyj8iklXK8mzuaM6FM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HtdS4Oy0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="HtdS4Oy0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 403FCC4CEE5; Tue, 8 Apr 2025 12:42:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744116121; bh=TMkpjeZ7dMC/IVfzRg7CaMxvoF4FqLi41cWES71dy7M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HtdS4Oy06JKmuIahgIvITeHVKoL1VkMVEnPLW07fsPaWVmZkDmXVetJiBASGjSAee Y0nkx2Ln9zzuvkyruyD6ju8BRTpFwsZ0KhtzE4K9UM1KVG0NfclrkNshpSBR1/ieok dOv5HDAtSzUoK5jFOHrVfDnevwaprgI/FTOc35XQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Qiuxu Zhuo , Tony Luck , Gary Wang , Sasha Levin Subject: [PATCH 6.12 023/423] EDAC/ie31200: Fix the error path order of ie31200_init() Date: Tue, 8 Apr 2025 12:45:49 +0200 Message-ID: <20250408104846.284460872@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250408104845.675475678@linuxfoundation.org> References: <20250408104845.675475678@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Qiuxu Zhuo [ Upstream commit 231e341036d9988447e3b3345cf741a98139199e ] The error path order of ie31200_init() is incorrect, fix it. Fixes: 709ed1bcef12 ("EDAC/ie31200: Fallback if host bridge device is already initialized") Signed-off-by: Qiuxu Zhuo Signed-off-by: Tony Luck Tested-by: Gary Wang Link: https://lore.kernel.org/r/20250310011411.31685-4-qiuxu.zhuo@intel.com Signed-off-by: Sasha Levin --- drivers/edac/ie31200_edac.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/edac/ie31200_edac.c b/drivers/edac/ie31200_edac.c index 92714dd88b3f6..56be8ef40f376 100644 --- a/drivers/edac/ie31200_edac.c +++ b/drivers/edac/ie31200_edac.c @@ -617,7 +617,7 @@ static int __init ie31200_init(void) pci_rc = pci_register_driver(&ie31200_driver); if (pci_rc < 0) - goto fail0; + return pci_rc; if (!mci_pdev) { ie31200_registered = 0; @@ -628,11 +628,13 @@ static int __init ie31200_init(void) if (mci_pdev) break; } + if (!mci_pdev) { edac_dbg(0, "ie31200 pci_get_device fail\n"); pci_rc = -ENODEV; - goto fail1; + goto fail0; } + pci_rc = ie31200_init_one(mci_pdev, &ie31200_pci_tbl[i]); if (pci_rc < 0) { edac_dbg(0, "ie31200 init fail\n"); @@ -640,12 +642,12 @@ static int __init ie31200_init(void) goto fail1; } } - return 0; + return 0; fail1: - pci_unregister_driver(&ie31200_driver); -fail0: pci_dev_put(mci_pdev); +fail0: + pci_unregister_driver(&ie31200_driver); return pci_rc; } -- 2.39.5