public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Milton Miller <miltonm@bga.com>
To: Jiri Slaby <jslaby@suse.cz>
Cc: jbarnes@virtuousgeek.org, linux-pci@vger.kernel.org,
	xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org,
	jirislaby@gmail.com,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH 1/1] PCI: xen-pcifront, fix PCI reference leak
Date: Thu, 04 Nov 2010 12:27:07 -0600	[thread overview]
Message-ID: <xenfront-reffix-fixreq@mdm.bga.com> (raw)
In-Reply-To: <1288881090-27335-1-git-send-email-jslaby@suse.cz>

On 2010-11-04 at about 14:31:30 Jiri Slaby wrote:
> Stanse found that when pdev is found and has no driver a reference is
> leaked in pcifront_common_process. So add pci_dev_put there. For the
> pdev == NULL case, pci_dev_put(NULL) is fine.

While that may be true, the dev_err(&pcidev->dev ... is a NULL pointer
deref.

> 
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
>  drivers/pci/xen-pcifront.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
> index a87c498..f9ffc05 100644
> --- a/drivers/pci/xen-pcifront.c
> +++ b/drivers/pci/xen-pcifront.c
> @@ -578,6 +578,7 @@  static pci_ers_result_t pcifront_common_process(int cmd,
>  	if (!pcidev || !pcidev->driver) {
>  		dev_err(&pcidev->dev,
>  			"device or driver is NULL\n");
> +		pci_dev_put(pcidev);
>  		return result;
>  	}
>  	pdrv = pcidev->driver;
> 

milton

  reply	other threads:[~2010-11-04 18:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-04 14:31 [PATCH 1/1] PCI: xen-pcifront, fix PCI reference leak Jiri Slaby
2010-11-04 18:27 ` Milton Miller [this message]
2010-11-08 16:34   ` Konrad Rzeszutek Wilk
2010-11-09 10:27     ` Jiri Slaby

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=xenfront-reffix-fixreq@mdm.bga.com \
    --to=miltonm@bga.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=jirislaby@gmail.com \
    --cc=jslaby@suse.cz \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=xen-devel@lists.xensource.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