mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Logan Gunthorpe <logang@deltatee.com>
To: Yige Jiang <yigejiang86@gmail.com>, linux-pci@vger.kernel.org
Cc: Kurt Schwemmer <kurt.schwemmer@microsemi.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-kernel@vger.kernel.org, Daniel Stodden <dns@arista.com>
Subject: Re: [PATCH] PCI: switchtec: Fix PCI device reference leak on probe failure
Date: Thu, 5 Nov 2026 11:37:40 -0600	[thread overview]
Message-ID: <f1221775-424c-486e-bbd1-a7f3504ceb17@deltatee.com> (raw)
In-Reply-To: <rc-review-20261105-vc-149-07fa7f0c8a18@gmail.com>



On 2026-11-05 1:55 a.m., Yige Jiang wrote:
> stdev_create() takes a pci_dev reference for stdev->pdev. When a
> later step of switchtec_pci_probe() fails, err_put drops stdev->dev
> but omits the PCI device reference. stdev_release() only frees
> stdev, so the PCI device remains pinned after the failed probe.
> 
> Return the PCI device reference before putting stdev->dev, matching
> the existing cleanup in stdev_create() and switchtec_pci_remove().
> 
> Fixes: df25461119d9 ("PCI: switchtec: Fix stdev_release() crash after surprise hot remove")
> Signed-off-by: Yige Jiang <yigejiang86@gmail.com>

Thanks! This looks correct to me.

Reviewed-by: Logan Gunthorpe <logang@deltatee.com>

  reply	other threads:[~2026-11-05 17:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  7:55 Yige Jiang
2026-11-05 17:37 ` Logan Gunthorpe [this message]
2026-11-05 19:14 ` Bjorn Helgaas

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=f1221775-424c-486e-bbd1-a7f3504ceb17@deltatee.com \
    --to=logang@deltatee.com \
    --cc=bhelgaas@google.com \
    --cc=dns@arista.com \
    --cc=kurt.schwemmer@microsemi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=yigejiang86@gmail.com \
    /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®