summaryrefslogtreecommitdiffstats
path: root/net/llc/af_llc.c
diff options
context:
space:
mode:
authorOctavian Purdila <opurdila@ixiacom.com>2009-12-26 11:51:08 +0000
committerDavid S. Miller <davem@davemloft.net>2009-12-26 20:47:23 -0800
commit3100aa9d74db9c6d8d9a3b6421721fc1aef4728f (patch)
treee0a6cea30070c594f9addf79d762cbe521b49c29 /net/llc/af_llc.c
parent8beb9ab6c2df203e8d68cb1f48cf42604a6bed86 (diff)
downloadlinux-3100aa9d74db9c6d8d9a3b6421721fc1aef4728f.tar.bz2
llc: fix SAP reference counting w.r.t. socket handling
The SAP ref counter gets decremented twice when deleting a socket, although for all but the first socket of a SAP the SAP ref counter was incremented only once. Signed-off-by: Octavian Purdila <opurdila@ixiacom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/llc/af_llc.c')
-rw-r--r--net/llc/af_llc.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index f49f3dd6fbd3..e35d907fba2c 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -197,10 +197,8 @@ static int llc_ui_release(struct socket *sock)
llc->laddr.lsap, llc->daddr.lsap);
if (!llc_send_disc(sk))
llc_ui_wait_for_disc(sk, sk->sk_rcvtimeo);
- if (!sock_flag(sk, SOCK_ZAPPED)) {
- llc_sap_put(llc->sap);
+ if (!sock_flag(sk, SOCK_ZAPPED))
llc_sap_remove_socket(llc->sap, sk);
- }
release_sock(sk);
if (llc->dev)
dev_put(llc->dev);
@@ -352,7 +350,6 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen)
rc = -EBUSY; /* some other network layer is using the sap */
if (!sap)
goto out;
- llc_sap_hold(sap);
} else {
struct llc_addr laddr, daddr;
struct sock *ask;