summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}