Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2388556lqp; Sun, 24 Mar 2024 17:14:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXxajnwUPr1jwfYSAJN2860kizFQ98IM8PN8INTZbvl0HqDcND+G0AsX6HIGed27uE54XwEfsd3pqA8LghucFp30NwDrR7zH1lY6RM0EA== X-Google-Smtp-Source: AGHT+IHlvQ7iiG13TXUrjcJihv09dfiSRz0rI9gFr4DDFoPOPAwkdSMFpv7UIN2tvHN5peH+/2io X-Received: by 2002:a9d:6e16:0:b0:6e6:d1ac:c989 with SMTP id e22-20020a9d6e16000000b006e6d1acc989mr2061833otr.6.1711325645075; Sun, 24 Mar 2024 17:14:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711325645; cv=pass; d=google.com; s=arc-20160816; b=o/HIk5ZoNqGc8Y3atnt7Tfloey79gjvVqZkHzjqL1f41PsQzXocSlCJav4Ukn7eO+r iF+EjZ16QAoYqfaJybjyAFUe+ElIpv2D3880KweBeWZ9lOitMkrU7qMDHzh++3Q2Dgfl mrceMFqxYENmWzGKvcTg40inTx4Iw8TJIJdpMt+MYq+52bUs94Ry2i6Z7NFujLgR5B7z vE8PVfi1gJL4Ti/XWebEcUtImhDaqdJwl5nroHGJBT7txkSj9mQsvF1RFmyzlk+xQI42 xYhofIrMzSRLEruoo2LqN4Vdm/Uiva60p3gIg/7sA/jyjDp2E67YiyePs+1OROPMW9/V StNw== 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=CcVG8zK79Q8oINavyV2UE8Ir3WmoAS141hzkbGODqJU=; fh=Fa5RUXCdW7zqM1jt5YZV3ou228NlT+j7CjVmCSlLLKI=; b=reIH6u7F9DDIqUaCFG00P9we4MbCYal3l2aaEXyCrg1KwR0TY17qTueswQ2RaN/WO+ O+aT3uqK2eG56/d8qs9y/CgZ9whW55BtPriJ4MRS7/bxhkxvgcy4Sg1pchNTAf5A996X /uN9ZvGVpG3ZcX2veXLRLWbY222a/01sA30cuiUONAUIql/L+bUQJDuA2jbVGZUt2NNP /7UwzgWoWuwFyYjYM/IBYCMsbc8qRnDf6VcujW6cBYh01/DoD4vGREsYcYWRFSq3k3iU biDKLjO1AyGqq1wq51YQShdzBYKS4sQLeNbmc71EXisAu4WRYPQ6kQfvuuhkS8hD2cpZ NAwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ajPnLo+z; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113302-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113302-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 by8-20020a056a02058800b005dc87bb5496si7165236pgb.132.2024.03.24.17.14.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:14:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113302-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=ajPnLo+z; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113302-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113302-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 6C36EB21ADC for ; Mon, 25 Mar 2024 00:05:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF81F191078; Sun, 24 Mar 2024 22:41:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ajPnLo+z" 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 BE8E8191056; Sun, 24 Mar 2024 22:41:41 +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=1711320102; cv=none; b=PyDkqWgeZd80Fzx/zcKbadSC6F9Myp1735/OPpzAeeaFpfmkHluUBOapnRT1xO0SWeDdIXrkd8NAq/VHcDdohe/hmTikO2iKaTzq4E4CHuTMW3U3X79Zvq3F2j3LvaWvFwa9/mxc8UE5i/5qvb2+PDUh+xx5X4wp4aXpj74Bg/g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320102; c=relaxed/simple; bh=+9L2sOYcn70slea3K+0x6ySDW9NT356ZLSJHuWQ40e4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RKgzjaQSXP+0knI3DQnyBezfsZTjlW9/Ztj9AVD3Hdvmu2KxqDdlDUX3TTcfHhLpURUeatcjOycuKq9XeJ2k8jmnRObMFg+T7FUjd4ga+cg/+lehWDl0l8klKK4sFnT9O25rH9TpD20lzq6H4WWM77w48dor/Zp7PyITWw2JVmQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ajPnLo+z; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6840C433C7; Sun, 24 Mar 2024 22:41:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320101; bh=+9L2sOYcn70slea3K+0x6ySDW9NT356ZLSJHuWQ40e4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ajPnLo+znFgyGtiEpIp3UoAQy1dcyxSxTUnUULY6z6m8joLdT4iCCr02HYSelEhJu /1rmT0dxN54el2bcCH62Be923+yS/dYrWaUmktNbzesV4pqLpZk+88R49mBaZhg/qC huQ1UtVH/v0ONv99wTfIdcjUw+7obrDeKmZF6sPnKVJU4/N3a5CmgHw4u2dZMWL9uQ gzF98sd32cEDH9ozunV9jYw1gfS4Wwo9mXCE2CGZmcgNcO/AF1nRWe/PZL82V5uJoH 3HGb0xLvOWVfmGyhOiePBVTWhHtB4IwdYG3dznc63ufKjwMPiriJKGkfQuM0Qb4eRX kW4h4SsFliheQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christophe JAILLET , Bjorn Helgaas , Sasha Levin Subject: [PATCH 6.8 410/715] PCI: switchtec: Fix an error handling path in switchtec_pci_probe() Date: Sun, 24 Mar 2024 18:29:49 -0400 Message-ID: <20240324223455.1342824-411-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-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 1804794d0e686..5a4adf6c04cf8 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -1672,7 +1672,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 | @@ -1693,6 +1693,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