Showing error 823

User: Jiri Slaby
Error type: Resource Leak
Error type description: The code omits to put the resource to the system for reuse
File location: drivers/hwmon/vt8231.c
Line in file: 977
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2011-11-07 22:40:13 UTC


Source:

 947                                 upgrade BIOS or use force_addr=0xaddr\n");
 948                return -ENODEV;
 949        }
 950
 951        if (PCIBIOS_SUCCESSFUL != pci_read_config_word(dev, VT8231_ENABLE_REG,
 952                                                        &val))
 953                return -ENODEV;
 954
 955        if (!(val & 0x0001)) {
 956                dev_warn(&dev->dev, "enabling sensors\n");
 957                if (PCIBIOS_SUCCESSFUL !=
 958                        pci_write_config_word(dev, VT8231_ENABLE_REG,
 959                                                        val | 0x0001))
 960                        return -ENODEV;
 961        }
 962
 963        if (platform_driver_register(&vt8231_driver))
 964                goto exit;
 965
 966        /* Sets global pdev as a side effect */
 967        if (vt8231_device_add(address))
 968                goto exit_unregister;
 969
 970        /* Always return failure here.  This is to allow other drivers to bind
 971         * to this pci device.  We don't really want to have control over the
 972         * pci device, we only wanted to read as few register values from it.
 973         */
 974
 975        /* We do, however, mark ourselves as using the PCI device to stop it
 976           getting unloaded. */
 977        s_bridge = pci_dev_get(dev);
 978        return -ENODEV;
 979
 980exit_unregister:
 981        platform_driver_unregister(&vt8231_driver);
 982exit:
 983        return -ENODEV;
 984}
 985
 986static int __init sm_vt8231_init(void)
 987{
Show full sources