From: Greg Kurz <groug@kaod.org>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-stable@nongnu.org, qemu-ppc@nongnu.org,
qemu-devel@nongnu.org, "Cédric Le Goater" <clg@kaod.org>
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] spapr_pci: Fix interrupt leak in rtas_ibm_change_msi() error path
Date: Fri, 8 Feb 2019 12:15:03 +0100 [thread overview]
Message-ID: <20190208121503.38e8c9ae@bahia.lan> (raw)
In-Reply-To: <20190207230647.GC518@umbus.fritz.box>
[-- Attachment #1: Type: text/plain, Size: 1596 bytes --]
On Fri, 8 Feb 2019 10:06:47 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:
> On Thu, Feb 07, 2019 at 06:28:37PM +0100, Greg Kurz wrote:
> > Now that IRQ allocation has been split in two (first allocate IRQ numbers,
> > then claim them), if the claiming fails, we must release the IRQs.
> >
> > Fixes: 4fe75a8ccd80 "spapr: split the IRQ allocation sequence"
> > Signed-off-by: Greg Kurz <groug@kaod.org>
>
> Applied to ppc-for-4.0, thanks.
>
Oops I've just realized there's an off-by-one error...
> > ---
> > hw/ppc/spapr_pci.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> > index 41d81f4a8500..6fe3c10c8d4c 100644
> > --- a/hw/ppc/spapr_pci.c
> > +++ b/hw/ppc/spapr_pci.c
> > @@ -393,6 +393,12 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, sPAPRMachineState *spapr,
> > for (i = 0; i < req_num; i++) {
> > spapr_irq_claim(spapr, irq + i, false, &err);
> > if (err) {
> > + if (i) {
> > + spapr_irq_free(spapr, irq, i + 1);
... here. It should actually be:
+ spapr_irq_free(spapr, irq, i);
Can you fix this in your tree or should I post a v2 ?
> > + }
> > + if (!smc->legacy_irq_allocation) {
> > + spapr_irq_msi_free(spapr, irq, req_num);
> > + }
> > error_reportf_err(err, "Can't allocate MSIs for device %x: ",
> > config_addr);
> > rtas_st(rets, 0, RTAS_OUT_HW_ERROR);
> >
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-02-08 11:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-07 17:28 [Qemu-devel] [PATCH] spapr_pci: Fix interrupt leak in rtas_ibm_change_msi() error path Greg Kurz
2019-02-07 23:06 ` David Gibson
2019-02-08 11:15 ` Greg Kurz [this message]
2019-02-08 11:33 ` [Qemu-devel] [Qemu-ppc] " David Gibson
2019-02-08 12:54 ` Greg Kurz
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=20190208121503.38e8c9ae@bahia.lan \
--to=groug@kaod.org \
--cc=clg@kaod.org \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-stable@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.