mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Greg KH <gregkh@suse.de>
Cc: Matthew Wilcox <matthew@wil.cx>, Alex Chiang <achiang@hp.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: refcount leak in pci_get_device()?
Date: Thu, 21 Aug 2008 15:23:35 -0700	[thread overview]
Message-ID: <200808211523.35556.jbarnes@virtuousgeek.org> (raw)
In-Reply-To: <20080821204758.GB31543@suse.de>

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@suse.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@wil.cx>
> Cc: Alex Chiang <achiang@hp.com>
> Cc: stable <stable@kernel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.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

  parent reply	other threads:[~2008-08-21 22:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-21 20:19 Alex Chiang
2008-08-21 20:25 ` Matthew Wilcox
2008-08-21 20:47   ` Greg KH
2008-08-21 22:14     ` Alex Chiang
2008-08-30  4:23       ` Zhao, Yu
2008-08-30  5:37         ` Greg KH
2008-08-30  6:20           ` Zhao, Yu
2008-08-31  3:14             ` problems in fakephp (was RE: refcount leak in pci_get_device()?) Zhao, Yu
2008-09-01 18:40               ` [PATCH] PCI Hotplug: fakephp: fix deadlock... again Alex Chiang
2008-09-02  0:10                 ` Matthew Wilcox
2008-09-02  0:19                   ` Alex Chiang
2008-09-09  4:12                     ` Jesse Barnes
2008-09-09  4:27                       ` Matthew Wilcox
2008-09-09  5:32                         ` Andrew Patterson
2008-09-04 15:03                 ` Zhao, Yu
2008-08-21 22:23     ` Jesse Barnes [this message]
2008-08-22  1:04       ` refcount leak in pci_get_device()? Henrique de Moraes Holschuh
2008-08-22  1:09         ` Henrique de Moraes Holschuh
2008-08-21 20:40 ` Greg KH

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=200808211523.35556.jbarnes@virtuousgeek.org \
    --to=jbarnes@virtuousgeek.org \
    --cc=achiang@hp.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=matthew@wil.cx \
    /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®