Showing error 817

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


Source:

791        }
792        if (force_addr && address != force_addr) {
793                /* doesn't work for some chips? */
794                dev_err(&dev->dev, "Failed to force ISA address\n");
795                return -ENODEV;
796        }
797
798        if (PCIBIOS_SUCCESSFUL !=
799            pci_read_config_byte(dev, SIS5595_ENABLE_REG, &enable)) {
800                dev_err(&dev->dev, "Failed to read enable register\n");
801                return -ENODEV;
802        }
803        if (!(enable & 0x80)) {
804                if ((PCIBIOS_SUCCESSFUL !=
805                     pci_write_config_byte(dev, SIS5595_ENABLE_REG,
806                                           enable | 0x80))
807                 || (PCIBIOS_SUCCESSFUL !=
808                     pci_read_config_byte(dev, SIS5595_ENABLE_REG, &enable))
809                 || (!(enable & 0x80))) {
810                        /* doesn't work for some chips! */
811                        dev_err(&dev->dev, "Failed to enable HWM device\n");
812                        return -ENODEV;
813                }
814        }
815
816        if (platform_driver_register(&sis5595_driver)) {
817                dev_dbg(&dev->dev, "Failed to register sis5595 driver\n");
818                goto exit;
819        }
820
821        s_bridge = pci_dev_get(dev);
822        /* Sets global pdev as a side effect */
823        if (sis5595_device_add(address))
824                goto exit_unregister;
825
826        /* Always return failure here.  This is to allow other drivers to bind
827         * to this pci device.  We don't really want to have control over the
828         * pci device, we only wanted to read as few register values from it.
829         */
830        return -ENODEV;
831
Show full sources