slicoss's macaddr list adding bug?

devendra.aaru devendra.aaru at gmail.com
Tue Oct 23 21:26:44 UTC 2012


hi,

i think there's a bug in the list adding of the mac address,

its assigned as next pointer to the head of the list,
but the function checks for the next pointer whether its valid.

here's the function:

static int slic_mcast_add_list(struct adapter *adapter, char *address)
{
        struct mcast_address *mcaddr, *mlist;

        /* Check to see if it already exists */
        mlist = adapter->mcastaddrs;
        while (mlist) {
                if (!compare_ether_addr(mlist->address, address))
                        return 0;
                mlist = mlist->next;
        }

        /* Doesn't already exist.  Allocate a structure to hold it */
        mcaddr = kmalloc(sizeof(struct mcast_address), GFP_ATOMIC);
        if (mcaddr == NULL)
                return 1;

        memcpy(mcaddr->address, address, 6);

        mcaddr->next = adapter->mcastaddrs;
        adapter->mcastaddrs = mcaddr;

        return 0;
}

i think the list is linear, not circular and the next should point to null,

thanks,



More information about the devel mailing list