Showing error 808

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


Source:

 44        pci_write_config_byte(pmu_dev, PMU_LPCR, intensity + HW_LEVEL_MIN);
 45
 46        return 0;
 47}
 48
 49static int progearbl_get_intensity(struct backlight_device *bd)
 50{
 51        u8 intensity;
 52        pci_read_config_byte(pmu_dev, PMU_LPCR, &intensity);
 53
 54        return intensity - HW_LEVEL_MIN;
 55}
 56
 57static struct backlight_ops progearbl_ops = {
 58        .get_brightness = progearbl_get_intensity,
 59        .update_status = progearbl_set_intensity,
 60};
 61
 62static int progearbl_probe(struct platform_device *pdev)
 63{
 64        u8 temp;
 65        struct backlight_device *progear_backlight_device;
 66
 67        pmu_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, NULL);
 68        if (!pmu_dev) {
 69                printk("ALI M7101 PMU not found.\n");
 70                return -ENODEV;
 71        }
 72
 73        sb_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
 74        if (!sb_dev) {
 75                printk("ALI 1533 SB not found.\n");
 76                pci_dev_put(pmu_dev);
 77                return -ENODEV;
 78        }
 79
 80        /*     Set SB_MPS1 to enable brightness control. */
 81        pci_read_config_byte(sb_dev, SB_MPS1, &temp);
 82        pci_write_config_byte(sb_dev, SB_MPS1, temp | 0x20);
 83
 84        progear_backlight_device = backlight_device_register("progear-bl",
Show full sources