From: "Yang, Sheng" <sheng.yang@intel.com>
To: Alex Williamson <alex.williamson@hp.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH] kvm: device-assignment: Fix kvm_get_irq_route_gsi() return check
Date: Wed, 13 May 2009 11:36:57 +0800 [thread overview]
Message-ID: <200905131136.57555.sheng.yang@intel.com> (raw)
In-Reply-To: <20090512221144.5883.46470.stgit@dl380g6-3.ned.telco.ned.telco>
On Wednesday 13 May 2009 06:14:01 Alex Williamson wrote:
> Cast to a signed int to test for < 0.
>
> Signed-off-by: Alex Williamson <alex.williamson@hp.com>
> ---
>
> This supersedes "[PATCH] kvm: device-assignment: Catch GSI overflow"
>
> hw/device-assignment.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/hw/device-assignment.c b/hw/device-assignment.c
> index a6cc9b9..5bdae24 100644
> --- a/hw/device-assignment.c
> +++ b/hw/device-assignment.c
> @@ -798,7 +798,7 @@ static void assigned_dev_update_msi(PCIDevice *pci_dev,
> unsigned int ctrl_pos) pci_dev->cap.start + PCI_MSI_DATA_32);
> assigned_dev->entry->type = KVM_IRQ_ROUTING_MSI;
> assigned_dev->entry->gsi = kvm_get_irq_route_gsi(kvm_context);
> - if (assigned_dev->entry->gsi < 0) {
> + if ((int)(assigned_dev->entry->gsi) < 0) {
> perror("assigned_dev_update_msi: kvm_get_irq_route_gsi");
> return;
> }
Use a return value(r) seems better.
And I realized there is memory leak here. Entry seems haven't been freed for
error... So does MSI-X...
--
regards
Yang, Sheng
next prev parent reply other threads:[~2009-05-13 3:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-07 17:09 [PATCH] kvm: device-assignment: Catch GSI overflow Alex Williamson
2009-05-07 17:16 ` Alex Williamson
2009-05-08 9:28 ` Sheng Yang
2009-05-12 22:14 ` [PATCH] kvm: device-assignment: Fix kvm_get_irq_route_gsi() return check Alex Williamson
2009-05-13 3:36 ` Yang, Sheng [this message]
2009-05-13 3:55 ` Alex Williamson
2009-05-13 4:09 ` Yang, Sheng
2009-05-13 4:45 ` [PATCH v2] " Alex Williamson
2009-05-13 4:58 ` Yang, Sheng
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=200905131136.57555.sheng.yang@intel.com \
--to=sheng.yang@intel.com \
--cc=alex.williamson@hp.com \
--cc=kvm@vger.kernel.org \
/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