[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100125112156.7daa3bc2@jbarnes-piketon>
Date: Mon, 25 Jan 2010 11:21:56 -0800
From: Jesse Barnes <jbarnes@...tuousgeek.org>
To: Jiri Slaby <jslaby@...e.cz>
Cc: linux-kernel@...r.kernel.org, jirislaby@...il.com,
Scott Murray <scott@...teful.org>, linux-pci@...r.kernel.org
Subject: Re: [PATCH 1/1] PCI: hotplug/cpcihp, fix pci device refcounting
On Wed, 20 Jan 2010 14:15:54 +0100
Jiri Slaby <jslaby@...e.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@...e.cz>
> Cc: Scott Murray <scott@...teful.org>
> Cc: Jesse Barnes <jbarnes@...tuousgeek.org>
> Cc: linux-pci@...r.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists