Unlock all spinlocks in batgat
Commit Message
We leave get_ip_addr when a client was found in hash immediately, but have have
spinlocked hash_lock before. Spinlocks on non smp kernels are simple nops which
only disable peempt (only on peempt enabled kernels) and so will never lock
anything and no dead(spin)lock will happen.
More informations about this issue can be found in "Unreliable Guide To Locking"
under the section "Locks and Uniprocessor Kernels".
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
batman/linux/modules/gateway.c | 1 +
batman/linux/modules/gateway24.c | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
@@ -645,6 +645,7 @@ static struct gw_client *get_ip_addr(struct sockaddr_in *client_addr)
if (gw_client != NULL) {
DBG("found client in hash");
+ spin_unlock(&hash_lock);
return gw_client;
}
@@ -587,6 +587,7 @@ static struct gw_client *get_ip_addr(struct sockaddr_in *client_addr)
if (gw_client != NULL) {
printk(KERN_DEBUG "found client in hash");
+ spin_unlock(&hash_lock);
return gw_client;
}