lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTi=TxKKxjLdK-6Jwu9oBCiGHXJ8UxrAQH+C82wNK@mail.gmail.com>
Date:	Wed, 17 Nov 2010 00:20:43 +0100
From:	Vitaly Wool <vitalywool@...il.com>
To:	"Gustavo F. Padovan" <padovan@...fusion.mobi>
Cc:	pavan_savoy@...com, marcel@...tmann.org,
	linux-bluetooth@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5] Bluetooth: btwilink driver

>> +     /* Registration with ST layer is successful,
>> +      * hardware is ready to accept commands from HCI core.
>> +      */
>> +     if (test_and_set_bit(HCI_RUNNING, &hdev->flags)) {
>> +             clear_bit(HCI_RUNNING, &hdev->flags);
>> +             err = st_unregister(ST_BT);
>> +             if (err)
>> +                     BT_ERR("st_unregister() failed with error %d", err);
>> +             hst->st_write = NULL;
>> +     }
>
>
> What are you trying to do here? test_and_set_bit() result doesn't say
> nothing about error and you shall put test_and_set_bit should be in the
> beginning, to know if your device is already opened or not and then
> clear_bit if some error ocurrs during the function.
>

Yeap, this piece of code beats me is well. Why is it an error if this
bit wasn't already set?

~Vitaly
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ