2018-06-21 17:23:04

by Boris Ostrovsky

[permalink] [raw]
Subject: [PATCH] xen: Remove unnecessary BUG_ON from __unbind_from_irq()

Commit 910f8befdf5b ("xen/pirq: fix error path cleanup when binding
MSIs") fixed a couple of errors in error cleanup path of
xen_bind_pirq_msi_to_irq(). This cleanup allowed a call to
__unbind_from_irq() with an unbound irq, which would result in
triggering the BUG_ON there.

Since there is really no reason for the BUG_ON (xen_free_irq() can
operate on unbound irqs) we can remove it.

Reported-by: Ben Hutchings <[email protected]>
Signed-off-by: Boris Ostrovsky <[email protected]>
Cc: [email protected]
---
drivers/xen/events/events_base.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 762378f..08e4af0 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -628,8 +628,6 @@ static void __unbind_from_irq(unsigned int irq)
xen_irq_info_cleanup(info);
}

- BUG_ON(info_for_irq(irq)->type == IRQT_UNBOUND);
-
xen_free_irq(irq);
}

--
1.8.3.1



2018-06-22 06:00:05

by Jürgen Groß

[permalink] [raw]
Subject: Re: [PATCH] xen: Remove unnecessary BUG_ON from __unbind_from_irq()

On 21/06/18 19:29, Boris Ostrovsky wrote:
> Commit 910f8befdf5b ("xen/pirq: fix error path cleanup when binding
> MSIs") fixed a couple of errors in error cleanup path of
> xen_bind_pirq_msi_to_irq(). This cleanup allowed a call to
> __unbind_from_irq() with an unbound irq, which would result in
> triggering the BUG_ON there.
>
> Since there is really no reason for the BUG_ON (xen_free_irq() can
> operate on unbound irqs) we can remove it.
>
> Reported-by: Ben Hutchings <[email protected]>
> Signed-off-by: Boris Ostrovsky <[email protected]>
> Cc: [email protected]

Reviewed-by: Juergen Gross <[email protected]>


Juergen

2018-06-22 06:35:34

by Jürgen Groß

[permalink] [raw]
Subject: Re: [PATCH] xen: Remove unnecessary BUG_ON from __unbind_from_irq()

On 21/06/18 19:29, Boris Ostrovsky wrote:
> Commit 910f8befdf5b ("xen/pirq: fix error path cleanup when binding
> MSIs") fixed a couple of errors in error cleanup path of
> xen_bind_pirq_msi_to_irq(). This cleanup allowed a call to
> __unbind_from_irq() with an unbound irq, which would result in
> triggering the BUG_ON there.
>
> Since there is really no reason for the BUG_ON (xen_free_irq() can
> operate on unbound irqs) we can remove it.
>
> Reported-by: Ben Hutchings <[email protected]>
> Signed-off-by: Boris Ostrovsky <[email protected]>
> Cc: [email protected]

Pushed to xen/tip.git for-linus-4.18


Juergen

2018-06-22 07:10:27

by Roger Pau Monne

[permalink] [raw]
Subject: Re: [PATCH] xen: Remove unnecessary BUG_ON from __unbind_from_irq()

On Thu, Jun 21, 2018 at 01:29:44PM -0400, Boris Ostrovsky wrote:
> Commit 910f8befdf5b ("xen/pirq: fix error path cleanup when binding
> MSIs") fixed a couple of errors in error cleanup path of
> xen_bind_pirq_msi_to_irq(). This cleanup allowed a call to
> __unbind_from_irq() with an unbound irq, which would result in
> triggering the BUG_ON there.
>
> Since there is really no reason for the BUG_ON (xen_free_irq() can
> operate on unbound irqs) we can remove it.
>
> Reported-by: Ben Hutchings <[email protected]>
> Signed-off-by: Boris Ostrovsky <[email protected]>

Reviewed-by: Roger Pau Monn? <[email protected]>

Thanks, I had this on my queue of TODOs.