mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Jiri Slaby <jslaby@suse.cz>
Cc: linux-kernel@vger.kernel.org, jirislaby@gmail.com,
	Scott Murray <scott@spiteful.org>,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH 1/1] PCI: hotplug/cpcihp, fix pci device refcounting
Date: Mon, 25 Jan 2010 11:21:56 -0800	[thread overview]
Message-ID: <20100125112156.7daa3bc2@jbarnes-piketon> (raw)
In-Reply-To: <1263993354-23066-1-git-send-email-jslaby@suse.cz>

On Wed, 20 Jan 2010 14:15:54 +0100
Jiri Slaby <jslaby@suse.cz> wrote:

> Stanse found an ommitted pci_dev_put on one error path in
> cpcihp_generic_init. The path is taken on !dev, but also when
> dev->hdr_type != PCI_HEADER_TYPE_BRIDGE. However it omits to
> pci_dev_put on the latter.
> 
> As it is fine to pass NULL to pci_dev_put, put it in there
> uncoditionally.
> 
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> Cc: Scott Murray <scott@spiteful.org>
> Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
> Cc: linux-pci@vger.kernel.org
> ---
>  drivers/pci/hotplug/cpcihp_generic.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/pci/hotplug/cpcihp_generic.c
> b/drivers/pci/hotplug/cpcihp_generic.c index 148fb46..fb3f846 100644
> --- a/drivers/pci/hotplug/cpcihp_generic.c
> +++ b/drivers/pci/hotplug/cpcihp_generic.c
> @@ -162,6 +162,7 @@ static int __init cpcihp_generic_init(void)
>  	dev = pci_get_slot(bus, PCI_DEVFN(bridge_slot, 0));
>  	if(!dev || dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) {
>  		err("Invalid bridge device %s", bridge);
> +		pci_dev_put(dev);
>  		return -EINVAL;
>  	}
>  	bus = dev->subordinate;

Applied to linux-next, thanks.

-- 
Jesse Barnes, Intel Open Source Technology Center

      reply	other threads:[~2010-01-25 19:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-20 13:15 Jiri Slaby
2010-01-25 19:21 ` Jesse Barnes [this message]

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=20100125112156.7daa3bc2@jbarnes-piketon \
    --to=jbarnes@virtuousgeek.org \
    --cc=jirislaby@gmail.com \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=scott@spiteful.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®