|
@@ -332,14 +332,14 @@ static unsigned int x25_new_lci(struct x25_neigh *nb)
|
|
/*
|
|
/*
|
|
* Deferred destroy.
|
|
* Deferred destroy.
|
|
*/
|
|
*/
|
|
-void x25_destroy_socket(struct sock *);
|
|
|
|
|
|
+static void __x25_destroy_socket(struct sock *);
|
|
|
|
|
|
/*
|
|
/*
|
|
* handler for deferred kills.
|
|
* handler for deferred kills.
|
|
*/
|
|
*/
|
|
static void x25_destroy_timer(unsigned long data)
|
|
static void x25_destroy_timer(unsigned long data)
|
|
{
|
|
{
|
|
- x25_destroy_socket((struct sock *)data);
|
|
|
|
|
|
+ x25_destroy_socket_from_timer((struct sock *)data);
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -349,12 +349,10 @@ static void x25_destroy_timer(unsigned long data)
|
|
* will touch it and we are (fairly 8-) ) safe.
|
|
* will touch it and we are (fairly 8-) ) safe.
|
|
* Not static as it's used by the timer
|
|
* Not static as it's used by the timer
|
|
*/
|
|
*/
|
|
-void x25_destroy_socket(struct sock *sk)
|
|
|
|
|
|
+static void __x25_destroy_socket(struct sock *sk)
|
|
{
|
|
{
|
|
struct sk_buff *skb;
|
|
struct sk_buff *skb;
|
|
|
|
|
|
- sock_hold(sk);
|
|
|
|
- lock_sock(sk);
|
|
|
|
x25_stop_heartbeat(sk);
|
|
x25_stop_heartbeat(sk);
|
|
x25_stop_timer(sk);
|
|
x25_stop_timer(sk);
|
|
|
|
|
|
@@ -385,7 +383,22 @@ void x25_destroy_socket(struct sock *sk)
|
|
/* drop last reference so sock_put will free */
|
|
/* drop last reference so sock_put will free */
|
|
__sock_put(sk);
|
|
__sock_put(sk);
|
|
}
|
|
}
|
|
|
|
+}
|
|
|
|
|
|
|
|
+void x25_destroy_socket_from_timer(struct sock *sk)
|
|
|
|
+{
|
|
|
|
+ sock_hold(sk);
|
|
|
|
+ bh_lock_sock(sk);
|
|
|
|
+ __x25_destroy_socket(sk);
|
|
|
|
+ bh_unlock_sock(sk);
|
|
|
|
+ sock_put(sk);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void x25_destroy_socket(struct sock *sk)
|
|
|
|
+{
|
|
|
|
+ sock_hold(sk);
|
|
|
|
+ lock_sock(sk);
|
|
|
|
+ __x25_destroy_socket(sk);
|
|
release_sock(sk);
|
|
release_sock(sk);
|
|
sock_put(sk);
|
|
sock_put(sk);
|
|
}
|
|
}
|