Skip to content

Commit

Permalink
[LLC]: Fix sap refcounting
Browse files Browse the repository at this point in the history
Thanks to Leslie Harlley Watter <[email protected]> for reporting the
problem an testing this patch.

Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Arnaldo Carvalho de Melo authored and davem330 committed Mar 21, 2006
1 parent 2342c99 commit 2e1f47c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion net/llc/af_llc.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,10 @@ 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))
if (!sock_flag(sk, SOCK_ZAPPED)) {
llc_sap_put(llc->sap);
llc_sap_remove_socket(llc->sap, sk);
}
release_sock(sk);
if (llc->dev)
dev_put(llc->dev);
Expand Down
1 change: 0 additions & 1 deletion net/llc/llc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ struct llc_sap *llc_sap_open(unsigned char lsap,
goto out;
sap->laddr.lsap = lsap;
sap->rcv_func = func;
llc_sap_hold(sap);
llc_add_sap(sap);
out:
write_unlock_bh(&llc_sap_list_lock);
Expand Down

0 comments on commit 2e1f47c

Please sign in to comment.