Bluetooth: Use ERR_PTR as return error from hci_connect
Use ERR_PTR mechanism to return error from hci_connect.
Signed-off-by: Ville Tervo <ville.tervo@nokia.com>
Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 16c7a4d..46c3edc 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1171,8 +1171,8 @@
}
conn = hci_connect(hdev, ACL_LINK, &cp->bdaddr, sec_level, auth_type);
- if (!conn) {
- err = -ENOMEM;
+ if (IS_ERR(conn)) {
+ err = PTR_ERR(conn);
goto unlock;
}