Re: [RFCv2 3/4] Bluetooth: Use ERR_PTR to return error from hci_connect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Briglia,

On Thu, Feb 17, 2011 at 10:39 AM,  <anderson.briglia@xxxxxxxxxxxxx> wrote:
> @@ -472,8 +474,8 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8
>        acl = hci_conn_hash_lookup_ba(hdev, ACL_LINK, dst);
>        if (!acl) {
>                acl = hci_conn_add(hdev, ACL_LINK, dst);
> -               if (!acl)
> -                       return NULL;
> +               if (IS_ERR(acl))
> +                       return acl;
>        }

Note that if you follow Gustavo's suggestion to keep hci_conn_add()
returning NULL on ENOMEM, you should change this as well:

if (!acl)
    return ERR_PTR(-ENOMEM);

Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux