[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200808211523.35556.jbarnes@virtuousgeek.org>
Date: Thu, 21 Aug 2008 15:23:35 -0700
From: Jesse Barnes <jbarnes@...tuousgeek.org>
To: Greg KH <gregkh@...e.de>
Cc: Matthew Wilcox <matthew@....cx>, Alex Chiang <achiang@...com>,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: refcount leak in pci_get_device()?
On Thursday, August 21, 2008 1:47 pm Greg KH wrote:
> Subject: PCI: fix reference leak in pci_get_dev_by_id()
>
> From: Greg Kroah-Hartman <gregkh@...e.de>
>
> Alex Chiang and Matthew Wilcox pointed out that pci_get_dev_by_id() does
> not properly decrement the reference on the from pointer if it is
> present, like the documentation for the function states it will.
>
> Cc: Matthew Wilcox <matthew@....cx>
> Cc: Alex Chiang <achiang@...com>
> Cc: stable <stable@...nel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
>
>
> diff --git a/drivers/pci/search.c b/drivers/pci/search.c
> index 217814f..3b3b5f1 100644
> --- a/drivers/pci/search.c
> +++ b/drivers/pci/search.c
> @@ -280,6 +280,8 @@ static struct pci_dev *pci_get_dev_by_id(const struct
> pci_device_id *id, match_pci_dev_by_id);
> if (dev)
> pdev = to_pci_dev(dev);
> + if (from)
> + pci_dev_put(from);
> return pdev;
> }
Wow, thanks Greg, that was fast. I applied this to my for-linus branch; I'll
ask Linus to pull it for 2.6.27.
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