public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: "Krzysztof Wilczyński" <kw@linux.com>
To: Ma Ke <make24@iscas.ac.cn>
Cc: bhelgaas@google.com, treding@nvidia.com, arnd@arndb.de,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, stable@vger.kernel.org
Subject: Re: [PATCH v2 RESEND] PCI: fix reference leak in pci_register_host_bridge()
Date: Mon, 3 Mar 2025 16:42:50 +0900	[thread overview]
Message-ID: <20250303074250.GA138071@rocinante> (raw)
In-Reply-To: <20250303072117.3874694-1-make24@iscas.ac.cn>

Hello,

> Once device_register() failed, we should call put_device() to
> decrement reference count for cleanup. Or it could cause memory leak.
> 
> device_register() includes device_add(). As comment of device_add()
> says, 'if device_add() succeeds, you should call device_del() when you
> want to get rid of it. If device_add() has not succeeded, use only
> put_device() to drop the reference count'.
> 
> Found by code review.

Bjorn took this already, see:

  https://lore.kernel.org/linux-pci/20250227220124.GA19560@bhelgaas

That said, you need to ease on the resends a bit.  We track your patches
and we will get to these eventually.  Please relax a bit, and perhaps focus
your energy here on offering code reviews for other changes, which is
always a great thing to do and helps us a lot. :)

Thank you!

	Krzysztof

  reply	other threads:[~2025-03-03  7:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-03  7:21 [PATCH v2 RESEND] PCI: fix reference leak in pci_register_host_bridge() Ma Ke
2025-03-03  7:42 ` Krzysztof Wilczyński [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-02-25  2:14 Ma Ke
2025-02-27 22:01 ` 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=20250303074250.GA138071@rocinante \
    --to=kw@linux.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=make24@iscas.ac.cn \
    --cc=stable@vger.kernel.org \
    --cc=treding@nvidia.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