From liodot@gmail.com Mon Oct 20 16:09:27 2008 From: "Lior Dotan" Date: Sun, 12 Oct 2008 08:43:33 +0200 Subject: Staging: SLICOSS: Free multicast list at driver exit To: "Greg KH" Message-ID: The multicast address list is allocated in slic_mcast_add_list() but never freed. Signed-off-by: Lior Dotan --- drivers/staging/slicoss/slicoss.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/drivers/staging/slicoss/slicoss.c +++ b/drivers/staging/slicoss/slicoss.c @@ -596,6 +596,7 @@ static void __devexit slic_entry_remove( 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( 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);