slicoss's macaddr list adding bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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,
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux