Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2639288lqp; Mon, 25 Mar 2024 05:22:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW4MuA4oX730jpUDRvBzrjv8wk5YPoDy7zz9t68uXIb4i1aDbi54wIb8m5s8iLakJH3nrmf6lr7Xc0uh78yoOpEKmI0ipd+5Yq2bom7Zw== X-Google-Smtp-Source: AGHT+IEhnAZTyMGZYRxagk102LfU65pTr8QdAOUJgZh8XeR3jj3po4k3iGyK4WNvW4IHScSpMIQW X-Received: by 2002:a05:6a00:b42:b0:6e8:fa01:1735 with SMTP id p2-20020a056a000b4200b006e8fa011735mr7199181pfo.30.1711369339090; Mon, 25 Mar 2024 05:22:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711369339; cv=pass; d=google.com; s=arc-20160816; b=r5Qg+XyeHZXloipMjlqwGnU7rh739ss41soFPAurIawUALbnuJ84Iqoh/bId46MRwm 2kmEMJL0W1MK25047Pg65NohFBUjdsGH02gUEDTRXwyLbpLXpctHVqsCNtv01CxEhdww 7tlal3+LV5gJJDYtoii01aRy74vC2BQnYiVPWdoYjIGfBp67n2LpExcT4HDAq9JSwO1h h48St9+1UQrKocR6SOz3O5df8HhmABanB1cuVdJtHzYG7fnA0uemPeMNrCp379oNEK45 xUO1XQF3b5fxwuVc9ChWo8Mgd9JoFACA/hlBKDvz8cOH4GGnesRClGCjuzOZv/Wt/+cH qzkg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=eUYTFhgavDALtxTB39h1gjixwSnJNN9PWrVGUbjWNT4=; fh=Fa5RUXCdW7zqM1jt5YZV3ou228NlT+j7CjVmCSlLLKI=; b=02dJAC1w24besBidIlc3DELZwNZPZaZ2AeYyin2tqFWrlQkKOMdUw4N74GEu02uW1f Q3SRItx1CroJPD6yIy0Hwp3eQ9KyCgIXotXXJVURg45TxH43ZS5P3fMNH59aiLHYryua fvHGez0p9bSroE7S26GP7JPKKW7JLASZhGu+nKjJT74ioOYsu41kNlsaomRpr9F2xB1M SXga/bOM68uKjgEjhRZNIhcBRdL5WeGhPWk65MPQ66fX8tSdpqbKCvvgjNAlc6jMFCrv RQaFQvF2flP+IBBAljj5FKELY6DSGqAYSs0xFV108eJBhaAuj1dUakT3XFj4AjTi1Sh0 0A/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dRceyeT7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115952-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115952-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id u9-20020a63ef09000000b005e270acf8f3si7122708pgh.748.2024.03.25.05.22.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 05:22:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115952-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dRceyeT7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115952-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115952-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id BEB91B45FDC for ; Mon, 25 Mar 2024 09:51:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D460D391407; Mon, 25 Mar 2024 03:04:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dRceyeT7" 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 460AA22E165; Sun, 24 Mar 2024 23:16:37 +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=1711322198; cv=none; b=iL4fzYXA1qeAqiDodHS/rOmxqvouYPU3vDnwHS6qWNUG6Dzwz1ydu7IJ25lQAvX4RvFVVHCQPfvxoie0/jA1ZhcHFkoIOTaH4m6xtnL6PqIIMUkiQt3opKr9Ok7B7k5RCGc4pKpjBsZF2I1iACh2JGXYPjO6hpGGcQpcBdjtT/M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322198; c=relaxed/simple; bh=u9V+WyAANI9l04UH2rsHq7yZipBH/zr5JZGM795s4MI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KIH0NSIkCDZ2feS7JxxkBaNi1/ecezLVjkNH3SnhvU6EUejG0R4BXGfdkuMrz1hDUosdvzUajQthSAlb1/p6favT4X5JP29J0zyTAQzIHwMAF9yz+Rs7pn+DCsCbZ9EA2WFQPCX37P2WatPwOlXkrV9XC7kq9RWh1kuso+yzP98= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dRceyeT7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 839D9C43399; Sun, 24 Mar 2024 23:16:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711322197; bh=u9V+WyAANI9l04UH2rsHq7yZipBH/zr5JZGM795s4MI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dRceyeT7O23LeciVxCuXR0xKygcSgz+cOcDOxkqAnPq7J5XWOYh+lad/YIzyzMSE1 dW+OBiM5AstuYII9NvAjBp46lEQ9JKzFpqOV+hr+4VVJNeln1cJAx7DuCmAMhQeWMB X1AnRiYrgFoyyy2qO5DO3OUKu2uGqGkOvL4ZkEhtma+gom22YCZYBF2OsttFjMr1/f QY3XsLZNaGttqSs51G1rZpdPXuzQBAzfFoxP5sU1MN+dJkdlruJR/RxwLoxES/eGQo VqEfYaIn1fmeuQcLQppqh40kG8WYBxZxDr5USyyXwbTqJ5X6mPhFnYf3eQmDfEvo/w RRRfMfT/Z9Mgw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christophe JAILLET , Bjorn Helgaas , Sasha Levin Subject: [PATCH 6.1 276/451] PCI: switchtec: Fix an error handling path in switchtec_pci_probe() Date: Sun, 24 Mar 2024 19:09:12 -0400 Message-ID: <20240324231207.1351418-277-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Christophe JAILLET [ Upstream commit dec529b0b0572b32f9eb91c882dd1f08ca657efb ] The commit in Fixes changed the logic on how resources are released and introduced a new switchtec_exit_pci() that need to be called explicitly in order to undo a corresponding switchtec_init_pci(). This was done in the remove function, but not in the probe. Fix the probe now. Fixes: df25461119d9 ("PCI: switchtec: Fix stdev_release() crash after surprise hot remove") Link: https://lore.kernel.org/r/01446d2ccb91a578239915812f2b7dfbeb2882af.1703428183.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Bjorn Helgaas Signed-off-by: Sasha Levin --- drivers/pci/switch/switchtec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c index 3f3320d0a4f8f..d05a482639e3c 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -1674,7 +1674,7 @@ static int switchtec_pci_probe(struct pci_dev *pdev, rc = switchtec_init_isr(stdev); if (rc) { dev_err(&stdev->dev, "failed to init isr.\n"); - goto err_put; + goto err_exit_pci; } iowrite32(SWITCHTEC_EVENT_CLEAR | @@ -1695,6 +1695,8 @@ static int switchtec_pci_probe(struct pci_dev *pdev, err_devadd: stdev_kill(stdev); +err_exit_pci: + switchtec_exit_pci(stdev); err_put: ida_free(&switchtec_minor_ida, MINOR(stdev->dev.devt)); put_device(&stdev->dev); -- 2.43.0