Showing error 591

User: Jiri Slaby
Error type: Double Resource Put
Error type description: There is a try to return some resource to the system twice
File location: drivers/mtd/maps/l440gx.c
Line in file: 108
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2011-11-07 22:20:28 UTC


Source:

 78        if (!l440gx_map.virt) {
 79                printk(KERN_WARNING "Failed to ioremap L440GX flash region\n");
 80                pci_dev_put(pm_dev);
 81                return -ENOMEM;
 82        }
 83        simple_map_init(&l440gx_map);
 84        printk(KERN_NOTICE "window_addr = 0x%08lx\n", (unsigned long)l440gx_map.virt);
 85
 86        /* Setup the pm iobase resource
 87         * This code should move into some kind of generic bridge
 88         * driver but for the moment I'm content with getting the
 89         * allocation correct.
 90         */
 91        pm_iobase = &pm_dev->resource[PIIXE_IOBASE_RESOURCE];
 92        if (!(pm_iobase->flags & IORESOURCE_IO)) {
 93                pm_iobase->name = "pm iobase";
 94                pm_iobase->start = 0;
 95                pm_iobase->end = 63;
 96                pm_iobase->flags = IORESOURCE_IO;
 97
 98                /* Put the current value in the resource */
 99                pci_read_config_dword(pm_dev, 0x40, &iobase);
100                iobase &= ~1;
101                pm_iobase->start += iobase & ~1;
102                pm_iobase->end += iobase & ~1;
103
104                pci_dev_put(pm_dev);
105
106                /* Allocate the resource region */
107                if (pci_assign_resource(pm_dev, PIIXE_IOBASE_RESOURCE) != 0) {
108                        pci_dev_put(dev);
109                        pci_dev_put(pm_dev);
110                        printk(KERN_WARNING "Could not allocate pm iobase resource\n");
111                        iounmap(l440gx_map.virt);
112                        return -ENXIO;
113                }
114        }
115        /* Set the iobase */
116        iobase = pm_iobase->start;
117        pci_write_config_dword(pm_dev, 0x40, iobase | 1);
118
Show full sources