Repository : ssh://git@open-mesh.org/batman-adv
On branch : next
commit 59f8434532df02aa9956b3f51d8abb71ced30625 Author: Antonio Quartulli ordex@autistici.org Date: Mon Oct 29 15:38:08 2012 +0100
batman-adv: free the dat hash only if not NULL
It could be the case that the user tries to disable DAT when it is already disabled. To prevent kernel oops, batadv_dat_hash_free() has to check for the hash table pointer being different from NULL before to try to free it.
This was introduced by ("batman-adv: Distributed ARP Table - add runtime switch")
Signed-off-by: Antonio Quartulli ordex@autistici.org Signed-off-by: Marek Lindner lindner_marek@yahoo.de
59f8434532df02aa9956b3f51d8abb71ced30625 distributed-arp-table.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/distributed-arp-table.c b/distributed-arp-table.c index 7921030..8e1d89d 100644 --- a/distributed-arp-table.c +++ b/distributed-arp-table.c @@ -634,6 +634,9 @@ out: */ static void batadv_dat_hash_free(struct batadv_priv *bat_priv) { + if (!bat_priv->dat.hash) + return; + __batadv_dat_purge(bat_priv, NULL);
batadv_hash_destroy(bat_priv->dat.hash);