From 30e7627219f985cd17a1ac24e0163ebcfb1277bf Mon Sep 17 00:00:00 2001 From: Ville Tervo Date: Tue, 22 Feb 2011 16:10:53 -0300 Subject: 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 Signed-off-by: Anderson Briglia Signed-off-by: Gustavo F. Padovan --- net/bluetooth/mgmt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'net/bluetooth/mgmt.c') diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 16c7a4d0432..46c3edc72cd 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -1171,8 +1171,8 @@ static int pair_device(struct sock *sk, u16 index, unsigned char *data, u16 len) } 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; } -- cgit v1.2.3-70-g09d2