Subject: Re: [AX25] kernel panic

From: Jarek Poplawski <[email-masked]>
Date: Sun, 30 Mar 2008 11:16:36 +0200

On Sun, Mar 30, 2008 at 10:43:07AM +0200, Bernard Pidoux wrote:
> Hi Jarek,

Hi Bernard,
>
> please find attached another collection of data from  
> /var/log/kernel/info.log that I bziped for it is rather large.

Thanks again. It looks like ROSE sockets aren't released properly.
Here is a try to fix this. Could you test it with all previous patches
present?

Regards,
Jarek P.

(patch #5)
---

diff -Nurp 2.6.24.4-/net/rose/af_rose.c 2.6.24.4+/net/rose/af_rose.c
--- 2.6.24.4-/net/rose/af_rose.c	2008-01-24 23:58:37.000000000 +0100
+++ 2.6.24.4+/net/rose/af_rose.c	2008-03-30 10:53:19.000000000 +0200
@@ -599,17 +599,24 @@ static int rose_release(struct socket *s
 
 	if (sk == NULL) return 0;
 
+	sock_hold(sk);
+	sock_orphan(sk);
+	lock_sock(sk);
 	rose = rose_sk(sk);
 
 	switch (rose->state) {
 	case ROSE_STATE_0:
+		release_sock(sk);
 		rose_disconnect(sk, 0, -1, -1);
+		lock_sock(sk);
 		rose_destroy_socket(sk);
 		break;
 
 	case ROSE_STATE_2:
 		rose->neighbour->use--;
+		release_sock(sk);
 		rose_disconnect(sk, 0, -1, -1);
+		lock_sock(sk);
 		rose_destroy_socket(sk);
 		break;
 
@@ -634,6 +641,8 @@ static int rose_release(struct socket *s
 	}
 
 	sock->sk = NULL;
+	release_sock(sk);
+	sock_put(sk);
 
 	return 0;
 }