linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] emulator: Fix condition check in btdev_create()
@ 2019-07-04  7:01 Inga Stotland
  2019-07-12 17:25 ` Gix, Brian
  0 siblings, 1 reply; 2+ messages in thread
From: Inga Stotland @ 2019-07-04  7:01 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: johan.hedberg, luiz.dentz, Inga Stotland

This fixes a case where logical '||' was used with constant operand
and the condition check always resulted in true.

Was: if (type == BTDEV_TYPE_BREDRLE || type == BTDEV_TYPE_LE
                                        || BTDEV_TYPE_BREDRLE50)
Fixed: if (type == BTDEV_TYPE_BREDRLE || type == BTDEV_TYPE_LE
                                        || type == BTDEV_TYPE_BREDRLE50)
---
 emulator/btdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/emulator/btdev.c b/emulator/btdev.c
index f4c79c2d0..38d5b3b1f 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -645,7 +645,7 @@ struct btdev *btdev_create(enum btdev_type type, uint16_t id)
 	memset(btdev, 0, sizeof(*btdev));
 
 	if (type == BTDEV_TYPE_BREDRLE || type == BTDEV_TYPE_LE
-				|| BTDEV_TYPE_BREDRLE50) {
+				|| type == BTDEV_TYPE_BREDRLE50) {
 		btdev->crypto = bt_crypto_new();
 		if (!btdev->crypto) {
 			free(btdev);
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH BlueZ] emulator: Fix condition check in btdev_create()
  2019-07-04  7:01 [PATCH BlueZ] emulator: Fix condition check in btdev_create() Inga Stotland
@ 2019-07-12 17:25 ` Gix, Brian
  0 siblings, 0 replies; 2+ messages in thread
From: Gix, Brian @ 2019-07-12 17:25 UTC (permalink / raw)
  To: linux-bluetooth, Stotland, Inga; +Cc: luiz.dentz, johan.hedberg

[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]

Applied.

On Thu, 2019-07-04 at 00:01 -0700, Inga Stotland wrote:
> This fixes a case where logical '||' was used with constant operand
> and the condition check always resulted in true.
> 
> Was: if (type == BTDEV_TYPE_BREDRLE || type == BTDEV_TYPE_LE
>                                         || BTDEV_TYPE_BREDRLE50)
> Fixed: if (type == BTDEV_TYPE_BREDRLE || type == BTDEV_TYPE_LE
>                                         || type ==
> BTDEV_TYPE_BREDRLE50)
> ---
>  emulator/btdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/emulator/btdev.c b/emulator/btdev.c
> index f4c79c2d0..38d5b3b1f 100644
> --- a/emulator/btdev.c
> +++ b/emulator/btdev.c
> @@ -645,7 +645,7 @@ struct btdev *btdev_create(enum btdev_type type,
> uint16_t id)
>  	memset(btdev, 0, sizeof(*btdev));
>  
>  	if (type == BTDEV_TYPE_BREDRLE || type == BTDEV_TYPE_LE
> -				|| BTDEV_TYPE_BREDRLE50) {
> +				|| type == BTDEV_TYPE_BREDRLE50) {
>  		btdev->crypto = bt_crypto_new();
>  		if (!btdev->crypto) {
>  			free(btdev);

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3250 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-12 17:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-04  7:01 [PATCH BlueZ] emulator: Fix condition check in btdev_create() Inga Stotland
2019-07-12 17:25 ` Gix, Brian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).