summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_core.c
diff options
context:
space:
mode:
authorJohan Hedberg2014-08-07 21:56:46 +0200
committerMarcel Holtmann2014-08-14 08:49:13 +0200
commitdc0f5088182b2e48ae47629a55bdf35ad5d6ed44 (patch)
treea274ffb62843c09e42f427af7868021ad38e60bf /net/bluetooth/l2cap_core.c
parentBluetooth: Remove special handling of ATT in l2cap_security_cfm() (diff)
downloadkernel-qcow2-linux-dc0f5088182b2e48ae47629a55bdf35ad5d6ed44.tar.gz
kernel-qcow2-linux-dc0f5088182b2e48ae47629a55bdf35ad5d6ed44.tar.xz
kernel-qcow2-linux-dc0f5088182b2e48ae47629a55bdf35ad5d6ed44.zip
Bluetooth: Refactor l2cap_connect_cfm
This patch is a simple refactoring of l2cap_connect_cfm to allow easier extension of the function. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r--net/bluetooth/l2cap_core.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 54cbfcd4da44..7a5cff89b792 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -7268,13 +7268,16 @@ void l2cap_connect_cfm(struct hci_conn *hcon, u8 status)
BT_DBG("hcon %p bdaddr %pMR status %d", hcon, &hcon->dst, status);
- if (!status) {
- conn = l2cap_conn_add(hcon);
- if (conn)
- l2cap_conn_ready(conn);
- } else {
+ if (status) {
l2cap_conn_del(hcon, bt_to_errno(status));
+ return;
}
+
+ conn = l2cap_conn_add(hcon);
+ if (!conn)
+ return;
+
+ l2cap_conn_ready(conn);
}
int l2cap_disconn_ind(struct hci_conn *hcon)