diff mbox

missing vgic_unlock_rank in gic_remove_irq_from_guest

Message ID alpine.DEB.2.10.1612081655450.22778@sstabellini-ThinkPad-X260 (mailing list archive)
State New, archived
Headers show

Commit Message

Stefano Stabellini Dec. 9, 2016, 12:59 a.m. UTC
Add missing vgic_unlock_rank on the error path in
gic_remove_irq_from_guest.

CID: 1381843

Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>

Comments

Julien Grall Dec. 9, 2016, 1:52 p.m. UTC | #1
Hi Stefano,

On 09/12/16 00:59, Stefano Stabellini wrote:
> Add missing vgic_unlock_rank on the error path in
> gic_remove_irq_from_guest.
>
> CID: 1381843

s/CID/Coverity-ID/ to stay inline with the other coverity patch.

>
> Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>

Reviewed-by: Julien Grall <julien.grall@arm.com>

This was introduced by commit 28e8ad2 "xen/arm: Release IRQ routed to a 
domain when it's destroying" in Xen 4.6. So it is probably worth to 
backport it up to Xen 4.6.

Cheers,
diff mbox

Patch

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 63c744a..a5348f2 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -205,7 +205,10 @@  int gic_remove_irq_from_guest(struct domain *d, unsigned int virq,
          */
         if ( test_bit(_IRQ_INPROGRESS, &desc->status) ||
              !test_bit(_IRQ_DISABLED, &desc->status) )
+        {
+            vgic_unlock_rank(v_target, rank, flags);
             return -EBUSY;
+        }
     }
 
     clear_bit(_IRQ_GUEST, &desc->status);