tipc: fix semaphore handling
Subsystems (3)
PATCH 3/4 tipc: fix semaphore handling
From: Andrew Morton <[email protected]>
As noted by Kevin, tipc's release() does down_interruptible() and ignores the return value. So if signal_pending() we'll end up doing up() on a non-downed semaphore. Fix.
Cc Kevin Winchester <[email protected]>
Cc Per Liden <[email protected]>
Cc Jon Maloy <[email protected]>
Cc Allan Stephens <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
net/tipc/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/tipc/socket.c renamed from net/tipc/socket.c~tipc-fix-semaphore-handling +1 -1
@@ -253,7 +253,7 @@ static int release(struct socket *sock)dbg ("sock_delete: %x\n" ,tsock);if (!tsock)return 0 ; -down_interruptible (&tsock->sem); +down (&tsock->sem);if (!sock->sk) {up (&tsock->sem);return 0 ;
_
David Miller
maintainerFrom: [email protected]
Date: Thu, 13 Dec 2007 16:02:36 -0800
Quoted 6 lines
From: Andrew Morton <[email protected]>
As noted by Kevin, tipc's
release()doesdown_interruptible()and ignores the return value. So ifsignal_pending()we'll end up doingup()on a non-downed semaphore. Fix.
Quoted 7 lines
Cc Kevin Winchester <[email protected]>Cc Per Liden <[email protected]>Cc Jon Maloy <[email protected]>Cc Allan Stephens <[email protected]>Cc "David S. Miller" <[email protected]>Cc <[email protected]>Signed-off-by Andrew Morton <[email protected]>
This is already in my net-2.6 tree, but thanks for resubmitting anyways :)