Showing error 1057

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: drivers/pci/access.c
Line in file: 91
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Entered: 2012-03-04 17:07:06 UTC


Source:

 61
 62EXPORT_SYMBOL(pci_bus_read_config_byte);
 63EXPORT_SYMBOL(pci_bus_read_config_word);
 64EXPORT_SYMBOL(pci_bus_read_config_dword);
 65EXPORT_SYMBOL(pci_bus_write_config_byte);
 66EXPORT_SYMBOL(pci_bus_write_config_word);
 67EXPORT_SYMBOL(pci_bus_write_config_dword);
 68
 69/*
 70 * The following routines are to prevent the user from accessing PCI config
 71 * space when it's unsafe to do so.  Some devices require this during BIST and
 72 * we're required to prevent it during D-state transitions.
 73 *
 74 * We have a bit per device to indicate it's blocked and a global wait queue
 75 * for callers to sleep on until devices are unblocked.
 76 */
 77static DECLARE_WAIT_QUEUE_HEAD(pci_ucfg_wait);
 78
 79static noinline void pci_wait_ucfg(struct pci_dev *dev)
 80{
 81        DECLARE_WAITQUEUE(wait, current);
 82
 83        __add_wait_queue(&pci_ucfg_wait, &wait);
 84        do {
 85                set_current_state(TASK_UNINTERRUPTIBLE);
 86                spin_unlock_irq(&pci_lock);
 87                schedule();
 88                spin_lock_irq(&pci_lock);
 89        } while (dev->block_ucfg_access);
 90        __remove_wait_queue(&pci_ucfg_wait, &wait);
 91}
 92
 93#define PCI_USER_READ_CONFIG(size,type)                                        \
 94int pci_user_read_config_##size                                                \
 95        (struct pci_dev *dev, int pos, type *val)                        \
 96{                                                                        \
 97        int ret = 0;                                                        \
 98        u32 data = -1;                                                        \
 99        if (PCI_##size##_BAD) return PCIBIOS_BAD_REGISTER_NUMBER;        \
100        spin_lock_irq(&pci_lock);                                        \
101        if (unlikely(dev->block_ucfg_access)) pci_wait_ucfg(dev);        \
Show full sources