PCI: rcar: Remove IRQ mappings in rcar_pcie_enable_msi() failpath
authorMarek Vasut <marek.vasut@gmail.com>
Thu, 24 May 2018 14:36:23 +0000 (16:36 +0200)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Thu, 24 May 2018 17:40:05 +0000 (18:40 +0100)
commit0bbf6b9230df602616a6c6f5861e8964e9162f4a
treec7de2e8e77ff4b2d2c1164409ca5f5393af01f91
parent1aea58be739816f05232c64f970784d75a84cd96
PCI: rcar: Remove IRQ mappings in rcar_pcie_enable_msi() failpath

The rcar_pcie_enable_msi() creates IRQ mappings using irq_create_mapping()
before requesting the IRQs using devm_request_irq(). If devm_request_irq()
fails for some reason, rcar_pcie_enable_msi() does not remove the mapping.

Pull out the code for disposing IRQ mappings from rcar_pcie_teardown_msi()
into a separate function and call it from both rcar_pcie_teardown_msi()
and rcar_pcie_enable_msi() failpath to remove the mappings correctly.

Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Phil Edworthy <phil.edworthy@renesas.com>
Cc: Simon Horman <horms+renesas@verge.net.au>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-renesas-soc@vger.kernel.org
drivers/pci/host/pcie-rcar.c