fpga: altera-cvp: fix 'bad IO access' on x86_64
authorAnatolij Gustschin <agust@denx.de>
Wed, 7 Nov 2018 17:51:45 +0000 (11:51 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:46:59 +0000 (19:46 +0100)
commitf060c825c45517abdbf60c01ba30f7407342fb24
tree8ddcccbe1480282747b247515b791a8e301bf223
parent42e19f5664f0d6fea33e3656ab577589de9252d3
fpga: altera-cvp: fix 'bad IO access' on x86_64

[ Upstream commit 187fade88ca0ff2df9d360ca751d948d73db7095 ]

If mapping the CvP BAR fails, we still can configure the FPGA via
PCI config space access. In this case the iomap pointer is NULL.
On x86_64, passing NULL address to pci_iounmap() generates
"Bad IO access at port 0x0" output with stack call trace. Fix it.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Alan Tull <atull@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/fpga/altera-cvp.c