linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Inga Stotland <inga.stotland@intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: johan.hedberg@gmail.com, luiz.dentz@gmail.com,
	Inga Stotland <inga.stotland@intel.com>
Subject: [PATCH BlueZ] emulator: Fix condition check in btdev_create()
Date: Thu,  4 Jul 2019 00:01:10 -0700	[thread overview]
Message-ID: <20190704070110.13815-1-inga.stotland@intel.com> (raw)

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


             reply	other threads:[~2019-07-04  7:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-04  7:01 Inga Stotland [this message]
2019-07-12 17:25 ` [PATCH BlueZ] emulator: Fix condition check in btdev_create() Gix, Brian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190704070110.13815-1-inga.stotland@intel.com \
    --to=inga.stotland@intel.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).