Showing error 832

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


Source:

1567        }
1568
1569        sis190_set_rgmii(tp, sis190_read_eeprom(ioaddr, EEPROMInfo));
1570
1571        return 0;
1572}
1573
1574/**
1575 *        sis190_get_mac_addr_from_apc - Get MAC address for SiS96x model
1576 *        @pdev: PCI device
1577 *        @dev:  network device to get address for
1578 *
1579 *        SiS96x model, use APC CMOS RAM to store MAC address.
1580 *        APC CMOS RAM is accessed through ISA bridge.
1581 *        MAC address is read into @net_dev->dev_addr.
1582 */
1583static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
1584                                                  struct net_device *dev)
1585{
1586        static const u16 __devinitdata ids[] = { 0x0965, 0x0966, 0x0968 };
1587        struct sis190_private *tp = netdev_priv(dev);
1588        struct pci_dev *isa_bridge;
1589        u8 reg, tmp8;
1590        unsigned int i;
1591
1592        net_probe(tp, KERN_INFO "%s: Read MAC address from APC.\n",
1593                  pci_name(pdev));
1594
1595        for (i = 0; i < ARRAY_SIZE(ids); i++) {
1596                isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, ids[i], NULL);
1597                if (isa_bridge)
1598                        break;
1599        }
1600
1601        if (!isa_bridge) {
1602                net_probe(tp, KERN_INFO "%s: Can not find ISA bridge.\n",
1603                          pci_name(pdev));
1604                return -EIO;
1605        }
1606
1607        /* Enable port 78h & 79h to access APC Registers. */
Show full sources