[ Upstream commit 910f8bef ]
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
Fixes: 4892c9b4 ("xen: add support for MSI message groups")
Reported-by: Hooman Mirhadi <email@example.com>
Signed-off-by: Roger Pau Monné <firstname.lastname@example.org>
Reviewed-by: Amit Shah <email@example.com>
Reviewed-by: Boris Ostrovsky <firstname.lastname@example.org>
Signed-off-by: Juergen Gross <email@example.com>
Signed-off-by: Sasha Levin <firstname.lastname@example.org>
Signed-off-by: Greg Kroah-Hartman <email@example.com>