mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: rjingar <rajvi.jingar@linux.intel.com>
To: irenic.rajneesh@gmail.com, david.e.box@intel.com,
	hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: rajvi.jingar@linux.intel.com,
	"David E . Box" <david.e.box@linux.intel.com>
Subject: [PATCH 1/8] platform/x86/intel/pmc: Fix in mtl_punit_pmt_init()
Date: Mon, 18 Dec 2023 20:22:09 -0800	[thread overview]
Message-ID: <20231219042216.2592029-1-rajvi.jingar@linux.intel.com> (raw)

From: Rajvi Jingar <rajvi.jingar@linux.intel.com>

pci_get_domain_bus_and_slot() increases the reference count on the pci
device that is used to register the endpoint. In case of failure in
registration, decrease reference count using pci_dev_put(pcidev) before
returning.

Fixes: 6e7964855381 ("platform/x86/intel/pmc: Show Die C6 counter on Meteor Lake")
Signed-off-by: Rajvi Jingar <rajvi.jingar@linux.intel.com>
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
---
 drivers/platform/x86/intel/pmc/mtl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/intel/pmc/mtl.c b/drivers/platform/x86/intel/pmc/mtl.c
index 38c2f946ec23..fb59dffccf28 100644
--- a/drivers/platform/x86/intel/pmc/mtl.c
+++ b/drivers/platform/x86/intel/pmc/mtl.c
@@ -985,6 +985,7 @@ static void mtl_punit_pmt_init(struct pmc_dev *pmcdev)
 	}
 
 	ep = pmt_telem_find_and_register_endpoint(pcidev, MTL_PMT_DMU_GUID, 0);
+	pci_dev_put(pcidev);
 	if (IS_ERR(ep)) {
 		dev_err(&pmcdev->pdev->dev,
 			"pmc_core: couldn't get DMU telem endpoint, %ld\n",
@@ -992,7 +993,6 @@ static void mtl_punit_pmt_init(struct pmc_dev *pmcdev)
 		return;
 	}
 
-	pci_dev_put(pcidev);
 	pmcdev->punit_ep = ep;
 
 	pmcdev->has_die_c6 = true;
-- 
2.34.1


             reply	other threads:[~2023-12-19  4:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-19  4:22 rjingar [this message]
2023-12-19  4:22 ` [PATCH 2/8] platform/x86/intel/pmc: Add PSON residency counter rjingar
2023-12-19  4:22 ` [PATCH 3/8] platform/x86/intel/pmc: Add regmap for Tiger Lake H PCH rjingar
2023-12-19  4:22 ` [PATCH 4/8] platform/x86/intel/pmc: Add PSON residency counter for Alder Lake rjingar
2023-12-19  4:22 ` [PATCH 5/8] platform/x86/intel/pmc: Move common code to core.c rjingar
2023-12-19  4:22 ` [PATCH 6/8] platform/x86/intel/pmc: Add ssram_init flag in PMC discovery in Meteor Lake rjingar
2023-12-19  4:22 ` [PATCH 7/8] platform/x86/intel/pmc: Add Arrow Lake S support to intel_pmc_core driver rjingar
2023-12-19  4:22 ` [PATCH 8/8] platform/x86/intel/pmc: Add Lunar Lake M " rjingar
2023-12-19 15:49 ` [PATCH 1/8] platform/x86/intel/pmc: Fix in mtl_punit_pmt_init() Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231219042216.2592029-1-rajvi.jingar@linux.intel.com \
    --to=rajvi.jingar@linux.intel.com \
    --cc=david.e.box@intel.com \
    --cc=david.e.box@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=irenic.rajneesh@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®