]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Staging: SLICOSS: Free multicast list at driver exit
authorLior Dotan <liodot@gmail.com>
Sun, 12 Oct 2008 06:43:33 +0000 (08:43 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 22 Oct 2008 16:56:37 +0000 (09:56 -0700)
The multicast address list is allocated in slic_mcast_add_list() but
never freed.

Signed-off-by: Lior Dotan <liodot@gmail.com>
drivers/staging/slicoss/slicoss.c

index 6ef9274a1a6c7772e4edec905e8ae2ad715b91a8..8fa9490b3e2ca707320e3ccafc28d21089a07b26 100644 (file)
@@ -596,6 +596,7 @@ static void __devexit slic_entry_remove(struct pci_dev *pcidev)
        uint mmio_len = 0;
        struct adapter *adapter = (struct adapter *) netdev_priv(dev);
        struct sliccard *card;
+       struct mcast_address *mcaddr, *mlist;
 
        ASSERT(adapter);
        DBG_MSG("slicoss: %s ENTER dev[%p] adapter[%p]\n", __func__, dev,
@@ -615,6 +616,13 @@ static void __devexit slic_entry_remove(struct pci_dev *pcidev)
        DBG_MSG("slicoss: %s iounmap dev->base_addr[%x]\n", __func__,
                (uint) dev->base_addr);
        iounmap((void __iomem *)dev->base_addr);
+       /* free multicast addresses */
+       mlist = adapter->mcastaddrs;
+       while (mlist) {
+               mcaddr = mlist;
+               mlist = mlist->next;
+               kfree(mcaddr);
+       }
        ASSERT(adapter->card);
        card = adapter->card;
        ASSERT(card->adapters_allocated);