Showing error 835

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/via686a.c
Line in file: 866
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2011-11-07 22:40:13 UTC


Source:

836        }
837
838        if (PCIBIOS_SUCCESSFUL !=
839            pci_read_config_word(dev, VIA686A_ENABLE_REG, &val))
840                return -ENODEV;
841        if (!(val & 0x0001)) {
842                if (!force_addr) {
843                        dev_warn(&dev->dev, "Sensors disabled, enable "
844                                 "with force_addr=0x%x\n", address);
845                        return -ENODEV;
846                }
847
848                dev_warn(&dev->dev, "Enabling sensors\n");
849                if (PCIBIOS_SUCCESSFUL !=
850                    pci_write_config_word(dev, VIA686A_ENABLE_REG,
851                                          val | 0x0001))
852                        return -ENODEV;
853        }
854
855        if (platform_driver_register(&via686a_driver))
856                goto exit;
857
858        /* Sets global pdev as a side effect */
859        if (via686a_device_add(address))
860                goto exit_unregister;
861
862        /* Always return failure here.  This is to allow other drivers to bind
863         * to this pci device.  We don't really want to have control over the
864         * pci device, we only wanted to read as few register values from it.
865         */
866        s_bridge = pci_dev_get(dev);
867        return -ENODEV;
868
869exit_unregister:
870        platform_driver_unregister(&via686a_driver);
871exit:
872        return -ENODEV;
873}
874
875static struct pci_driver via686a_pci_driver = {
876        .name                = "via686a",
Show full sources