Skip to content

Commit

Permalink
llc: fix SAP reference counting w.r.t. socket handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Octavian Purdila authored and David S. Miller committed Dec 27, 2009
1 parent 8beb9ab commit 3100aa9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions net/llc/af_llc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3100aa9

Please sign in to comment.