Commit 2e1f47c7 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller

[LLC]: Fix sap refcounting

Thanks to Leslie Harlley Watter <leslie@watter.org> for reporting the
problem an testing this patch.
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2342c990
...@@ -187,8 +187,10 @@ static int llc_ui_release(struct socket *sock) ...@@ -187,8 +187,10 @@ static int llc_ui_release(struct socket *sock)
llc->laddr.lsap, llc->daddr.lsap); llc->laddr.lsap, llc->daddr.lsap);
if (!llc_send_disc(sk)) if (!llc_send_disc(sk))
llc_ui_wait_for_disc(sk, sk->sk_rcvtimeo); 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); llc_sap_remove_socket(llc->sap, sk);
}
release_sock(sk); release_sock(sk);
if (llc->dev) if (llc->dev)
dev_put(llc->dev); dev_put(llc->dev);
......
...@@ -127,7 +127,6 @@ struct llc_sap *llc_sap_open(unsigned char lsap, ...@@ -127,7 +127,6 @@ struct llc_sap *llc_sap_open(unsigned char lsap,
goto out; goto out;
sap->laddr.lsap = lsap; sap->laddr.lsap = lsap;
sap->rcv_func = func; sap->rcv_func = func;
llc_sap_hold(sap);
llc_add_sap(sap); llc_add_sap(sap);
out: out:
write_unlock_bh(&llc_sap_list_lock); write_unlock_bh(&llc_sap_list_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment