Linux-Bluetooth Archive on lore.kernel.org
 help / color / Atom feed
From: "Gix, Brian" <brian.gix@intel.com>
To: "linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>,
	"Stotland, Inga" <inga.stotland@intel.com>
Cc: "luiz.dentz@gmail.com" <luiz.dentz@gmail.com>,
	"johan.hedberg@gmail.com" <johan.hedberg@gmail.com>
Subject: Re: [PATCH BlueZ] emulator: Fix condition check in btdev_create()
Date: Fri, 12 Jul 2019 17:25:17 +0000
Message-ID: <6d4bf5321409c4d348dd653dce82bda31eff2bcc.camel@intel.com> (raw)
In-Reply-To: <20190704070110.13815-1-inga.stotland@intel.com>

[-- 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 --]

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-04  7:01 Inga Stotland
2019-07-12 17:25 ` Gix, Brian [this message]

Reply instructions:

You may reply publically 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=6d4bf5321409c4d348dd653dce82bda31eff2bcc.camel@intel.com \
    --to=brian.gix@intel.com \
    --cc=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

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org linux-bluetooth@archiver.kernel.org
	public-inbox-index linux-bluetooth


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/ public-inbox