summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-04-26 20:01:38 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-04-26 20:01:38 +0200
commit8f54251ae9023d344eb34a082fb163cfee9ae385 (patch)
treed5cacfba1b7630805ca5fb88bb6b334f489bc1d9
parent3d82d03d20801d5c088e81ddaee0e85c5dc4f109 (diff)
downloadmodquicktun-8f54251ae9023d344eb34a082fb163cfee9ae385.tar
modquicktun-8f54251ae9023d344eb34a082fb163cfee9ae385.zip
Some minor bugfixes
-rw-r--r--quicktun.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/quicktun.c b/quicktun.c
index 3af7758..85ba52e 100644
--- a/quicktun.c
+++ b/quicktun.c
@@ -224,7 +224,7 @@ static void quicktun_udp_data_ready(struct sock *sk, int bytes)
addr->addr.sin_addr.s_addr = ip_hdr(skb)->saddr;
addr->addr.sin_port = udp_hdr(skb)->source;
- spin_lock(&tun->lock);
+ spin_lock_bh(&tun->lock);
if (tun->flags & QUICKTUN_FLAG_REMOTE_FLOAT) {
remote_addr = rcu_dereference_protected(tun->remote_address, lockdep_is_held(&tun->lock));
@@ -232,7 +232,7 @@ static void quicktun_udp_data_ready(struct sock *sk, int bytes)
call_rcu(&remote_addr->rcu, free_addr_struct);
}
- spin_unlock(&tun->lock);
+ spin_unlock_bh(&tun->lock);
}
else
goto drop;
@@ -511,6 +511,9 @@ err_free_sk:
sock_release(tun->sock);
err_free_dev:
+ if (tun->remote_address)
+ kfree(tun->remote_address);
+
free_netdev(dev);
return err;
}