Showing error 812

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


Source:

108        if (s->cb_cis_res)
109                cb_release_cis_mem(s);
110
111        start = res->start;
112        size = res->end - start + 1;
113        s->cb_cis_virt = ioremap(start, size);
114
115        if (!s->cb_cis_virt)
116                return -1;
117
118        s->cb_cis_res = res;
119
120        return 0;
121}
122
123/*=====================================================================
124
125    This is used by the CIS processing code to read CIS information
126    from a CardBus device.
127    
128=====================================================================*/
129
130int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void *ptr)
131{
132        struct pci_dev *dev;
133        struct resource *res;
134
135        cs_dbg(s, 3, "read_cb_mem(%d, %#x, %u)\n", space, addr, len);
136
137        dev = pci_get_slot(s->cb_dev->subordinate, 0);
138        if (!dev)
139                goto fail;
140
141        /* Config space? */
142        if (space == 0) {
143                if (addr + len > 0x100)
144                        goto failput;
145                for (; len; addr++, ptr++, len--)
146                        pci_read_config_byte(dev, addr, ptr);
147                return 0;
148        }
Show full sources