Add a check for BT socket before using it to unlink
in bt_accept_unlink(). This helps to avoid kernel panic.
Change-Id: Ie8919dedce239a3476c06ad48ebb3a0f731b9856
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
[update patch title]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
/* FIXME: Is this check still needed */
if (sk->sk_state == BT_CLOSED) {
release_sock(sk);
+#ifdef TIZEN_BT
+ if (bt_sk(sk)->parent)
+#endif
bt_accept_unlink(sk);
continue;
}
if (sk->sk_state == BT_CONNECTED || !newsock ||
test_bit(BT_SK_DEFER_SETUP, &bt_sk(parent)->flags)) {
+#ifdef TIZEN_BT
+ if (bt_sk(sk)->parent)
+#endif
bt_accept_unlink(sk);
if (newsock)
sock_graft(sk, newsock);