Commit 43986798 authored by Zhouyang Jia's avatar Zhouyang Jia Committed by Greg Kroah-Hartman

ipack: add error handling for ioremap_nocache

When ioremap_nocache fails, the lack of error-handling code may
cause unexpected results.

This patch adds error-handling code after calling ioremap_nocache.
Signed-off-by: default avatarZhouyang Jia <jiazhouyang09@gmail.com>
Acked-by: default avatarSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5c74f27b
...@@ -304,6 +304,13 @@ static int tpci200_register(struct tpci200_board *tpci200) ...@@ -304,6 +304,13 @@ static int tpci200_register(struct tpci200_board *tpci200)
ioremap_nocache(pci_resource_start(tpci200->info->pdev, ioremap_nocache(pci_resource_start(tpci200->info->pdev,
TPCI200_IP_INTERFACE_BAR), TPCI200_IP_INTERFACE_BAR),
TPCI200_IFACE_SIZE); TPCI200_IFACE_SIZE);
if (!tpci200->info->interface_regs) {
dev_err(&tpci200->info->pdev->dev,
"(bn 0x%X, sn 0x%X) failed to map driver user space!",
tpci200->info->pdev->bus->number,
tpci200->info->pdev->devfn);
goto out_release_mem8_space;
}
/* Initialize lock that protects interface_regs */ /* Initialize lock that protects interface_regs */
spin_lock_init(&tpci200->regs_lock); spin_lock_init(&tpci200->regs_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment