From: Wei Yongjun <yongjun_...@trendmicro.com.cn> Add the missing unlock on the error handle path in function nanoengine_read_config() and nanoengine_write_config().
Signed-off-by: Wei Yongjun <yongjun_...@trendmicro.com.cn> --- arch/arm/mach-sa1100/pci-nanoengine.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-sa1100/pci-nanoengine.c b/arch/arm/mach-sa1100/pci-nanoengine.c index ff02e2d..6ff07d7 100644 --- a/arch/arm/mach-sa1100/pci-nanoengine.c +++ b/arch/arm/mach-sa1100/pci-nanoengine.c @@ -67,8 +67,10 @@ static int nanoengine_read_config(struct pci_bus *bus, unsigned int devfn, int w spin_lock_irqsave(&nano_lock, flags); ret = nanoengine_get_pci_address(bus, devfn, where, &address); - if (ret != PCIBIOS_SUCCESSFUL) + if (ret != PCIBIOS_SUCCESSFUL) { + spin_unlock_irqrestore(&nano_lock, flags); return ret; + } v = __raw_readl(address); spin_unlock_irqrestore(&nano_lock, flags); @@ -95,8 +97,10 @@ static int nanoengine_write_config(struct pci_bus *bus, unsigned int devfn, int spin_lock_irqsave(&nano_lock, flags); ret = nanoengine_get_pci_address(bus, devfn, where, &address); - if (ret != PCIBIOS_SUCCESSFUL) + if (ret != PCIBIOS_SUCCESSFUL) { + spin_unlock_irqrestore(&nano_lock, flags); return ret; + } v = __raw_readl(address); switch (size) { case 1: -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/