[Bugme-new] [Bug 12537] New: drivers/net/netxen/netxen_nic_init.c:951: Memory leak: buf

bugme-daemon at bugzilla.kernel.org bugme-daemon at bugzilla.kernel.org
Sun Jan 25 03:06:12 PST 2009


http://bugzilla.kernel.org/show_bug.cgi?id=12537

           Summary: drivers/net/netxen/netxen_nic_init.c:951: Memory leak:
                    buf
           Product: Drivers
           Version: 2.5
     KernelVersion: latest git tree
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Network
        AssignedTo: jgarzik at pobox.com
        ReportedBy: danielm77 at spray.se


In the function netxen_pinit_from_rom there is this code...

        buf = kcalloc(n, sizeof(struct crb_addr_pair), GFP_KERNEL);
        if (buf == NULL) {
                printk("%s: netxen_pinit_from_rom: Unable to calloc memory.\n",
                                netxen_nic_driver_name);
                return -ENOMEM;
        }
        for (i = 0; i < n; i++) {
                if (netxen_rom_fast_read(adapter, 8*i + 4*offset, &val) != 0 ||
                netxen_rom_fast_read(adapter, 8*i + 4*offset + 4, &addr) != 0)
                        return -EIO;

There should be a kfree of buf before the "return -EIO".

This bug was found with cppcheck - http://cppcheck.wiki.sourceforge.net/


-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


More information about the Bugme-new mailing list