]> git.baikalelectronics.ru Git - kernel.git/commit
xen/pirq: fix error path cleanup when binding MSIs
authorRoger Pau Monne <roger.pau@citrix.com>
Wed, 28 Feb 2018 09:19:03 +0000 (09:19 +0000)
committerJuergen Gross <jgross@suse.com>
Wed, 28 Feb 2018 19:20:01 +0000 (20:20 +0100)
commitdb3b7298bae8a9d24abc340c588eba8f9dc20a46
treee7f207a9fdf7cce623ebc91248174a743ec2d427
parentfacd99144f69e0150f9e877f5395aac5ebb9f24e
xen/pirq: fix error path cleanup when binding MSIs

Current cleanup in the error path of xen_bind_pirq_msi_to_irq is
wrong. First of all there's an off-by-one in the cleanup loop, which
can lead to unbinding wrong IRQs.

Secondly IRQs not bound won't be freed, thus leaking IRQ numbers.

Note that there's no need to differentiate between bound and unbound
IRQs when freeing them, __unbind_from_irq will deal with both of them
correctly.

Fixes: 39ccd53f996b3d ("xen: add support for MSI message groups")
Reported-by: Hooman Mirhadi <mirhadih@amazon.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Amit Shah <aams@amazon.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/xen/events/events_base.c