[ATM]: Fix clip module reload crash.
authorRandy Dunlap <randy.dunlap@oracle.com>
Sun, 21 Oct 2007 23:24:27 +0000 (16:24 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 22 Oct 2007 09:59:52 +0000 (02:59 -0700)
net/atm/clip.c crashes the kernel if it (module) is loaded, removed,
and then loaded again.  Its exit call to neigh_table_clear()
should destroy the cache after freeing it.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/neighbour.c

index 67ba9914e52e78aadb1f0be6cde6fc0219c8c544..05979e35696320eeee0bbd5ae36d06ec50e496cc 100644 (file)
@@ -1438,6 +1438,9 @@ int neigh_table_clear(struct neigh_table *tbl)
        free_percpu(tbl->stats);
        tbl->stats = NULL;
 
+       kmem_cache_destroy(tbl->kmem_cachep);
+       tbl->kmem_cachep = NULL;
+
        return 0;
 }