Re: [RFC 4/4] Bluetooth: clean up hci code

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

 



Hi Andrei,

On Fri, Nov 26, 2010 at 11:22 AM, Emeltchenko Andrei
<Andrei.Emeltchenko.news@xxxxxxxxx> wrote:
> @@ -430,7 +433,8 @@ int hci_inquiry(void __user *arg)
>        hci_dev_unlock_bh(hdev);
>
>        timeo = ir.length * msecs_to_jiffies(2000);
> -       if (do_inquiry && (err = hci_request(hdev, hci_inq_req, (unsigned long)&ir, timeo)) < 0)
> +       err = hci_request(hdev, hci_inq_req, (unsigned long)&ir, timeo);
> +       if (do_inquiry && err < 0)
>                goto done;

I think there is a problem here. the "do_inquiry" flag will be checked
*after* the inquiry request is done. Maybe you should do something
like:

if (do_inquiry) {
    err = hci_request(hdev, hci_inq_req, (unsigned long)&ir, timeo);
    if (err < 0)
        goto done;
}

Regards,
-- 
Anderson Lizardo
OpenBossa Labs - 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