Showing error 846

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


Source:

 253                printk (KERN_WARNING "%s: Error EERPOM read %x\n",
 254                        pci_name(pci_dev), signature);
 255                return 0;
 256        }
 257
 258        /* get MAC address from EEPROM */
 259        for (i = 0; i < 3; i++)
 260                ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr);
 261
 262        return 1;
 263}
 264
 265/**
 266 *        sis630e_get_mac_addr - Get MAC address for SiS630E model
 267 *        @pci_dev: the sis900 pci device
 268 *        @net_dev: the net device to get address for
 269 *
 270 *        SiS630E model, use APC CMOS RAM to store MAC address.
 271 *        APC CMOS RAM is accessed through ISA bridge.
 272 *        MAC address is read into @net_dev->dev_addr.
 273 */
 274
 275static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev,
 276                                        struct net_device *net_dev)
 277{
 278        struct pci_dev *isa_bridge = NULL;
 279        u8 reg;
 280        int i;
 281
 282        isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0008, isa_bridge);
 283        if (!isa_bridge)
 284                isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0018, isa_bridge);
 285        if (!isa_bridge) {
 286                printk(KERN_WARNING "%s: Can not find ISA bridge\n",
 287                       pci_name(pci_dev));
 288                return 0;
 289        }
 290        pci_read_config_byte(isa_bridge, 0x48, &reg);
 291        pci_write_config_byte(isa_bridge, 0x48, reg | 0x40);
 292
 293        for (i = 0; i < 6; i++) {
Show full sources