From 47a07dd39d4ee2d14cf2e6b9a5a7ee8c2525aa67 Mon Sep 17 00:00:00 2001 From: Inga Stotland Date: Thu, 4 Jul 2019 00:01:10 -0700 Subject: [PATCH] emulator: Fix condition check in btdev_create() 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.47.3