From: Bjorn Helgaas <helgaas@kernel.org>
To: Cathy Avery <cavery@redhat.com>
Cc: kys@microsoft.com, haiyangz@microsoft.com, jakeo@microsoft.com,
bhelgaas@google.com, vkuznets@redhat.com,
devel@linuxdriverproject.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI: hv: Fix interrupt cleanup path
Date: Mon, 25 Jul 2016 12:37:50 -0500 [thread overview]
Message-ID: <20160725173750.GD12484@localhost> (raw)
In-Reply-To: <1468337484-16074-1-git-send-email-cavery@redhat.com>
On Tue, Jul 12, 2016 at 11:31:24AM -0400, Cathy Avery wrote:
> SR-IOV disabled from the host causes a memory leak.
> pci-hyperv usually first receives a PCI_EJECT notification
> and then proceeds to delete the hpdev list entry in
> hv_eject_device_work(). Later in hv_msi_free() since the
> device is no longer on the device list hpdev is NULL
> and hv_msi_free returns without freeing int_desc as part of
> hv_int_desc_free().
>
> Signed-off-by: Cathy Avery <cavery@redhat.com>
Applied with Jake's ack to pci/host-hv for v4.8, thanks!
For some reason, Jake's ack appears in patchwork and in my personal
email, but I don't see it on the mailing list. Maybe something in
http://vger.kernel.org/majordomo-info.html#taboo is relevant.
> ---
> drivers/pci/host/pci-hyperv.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
> index 7e9b2de..449d053 100644
> --- a/drivers/pci/host/pci-hyperv.c
> +++ b/drivers/pci/host/pci-hyperv.c
> @@ -732,16 +732,18 @@ static void hv_msi_free(struct irq_domain *domain, struct msi_domain_info *info,
>
> pdev = msi_desc_to_pci_dev(msi);
> hbus = info->data;
> - hpdev = get_pcichild_wslot(hbus, devfn_to_wslot(pdev->devfn));
> - if (!hpdev)
> + int_desc = irq_data_get_irq_chip_data(irq_data);
> + if (!int_desc)
> return;
>
> - int_desc = irq_data_get_irq_chip_data(irq_data);
> - if (int_desc) {
> - irq_data->chip_data = NULL;
> - hv_int_desc_free(hpdev, int_desc);
> + irq_data->chip_data = NULL;
> + hpdev = get_pcichild_wslot(hbus, devfn_to_wslot(pdev->devfn));
> + if (!hpdev) {
> + kfree(int_desc);
> + return;
> }
>
> + hv_int_desc_free(hpdev, int_desc);
> put_pcichild(hpdev, hv_pcidev_ref_by_slot);
> }
>
> --
> 2.5.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2016-07-25 17:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-12 15:31 [PATCH] PCI: hv: Fix interrupt cleanup path Cathy Avery
2016-07-25 17:37 ` Bjorn Helgaas [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=20160725173750.GD12484@localhost \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=cavery@redhat.com \
--cc=devel@linuxdriverproject.org \
--cc=haiyangz@microsoft.com \
--cc=jakeo@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=vkuznets@redhat.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;
as well as URLs for NNTP newsgroup(s).