Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1817371ybi; Thu, 4 Jul 2019 00:01:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxX5VvSujuKrhCiv9ji8cptm5eSpk1yaqJ3IcnILFq8NdEuBhi+L+VY8EuLMiv03NinOAl X-Received: by 2002:a65:44c8:: with SMTP id g8mr41482178pgs.443.1562223712380; Thu, 04 Jul 2019 00:01:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562223712; cv=none; d=google.com; s=arc-20160816; b=dNqztaR6Qmmy2aOFwk/ebPAndFCkpou7DpBTbt/orATOGRwDt2n3exgXZUmanhiCPH zCmiTz+xUSuXLvBUnEheYZ3G7dqmT9/S7ZD0cj32x+vXOe12guq8xUeJmLhpvyEi3mW/ 0SDJH1l0/l6QbTWcGyzx3mwS8u7HBg2Z8dsf5ugEvksW/HbREsZx8r1Zik9zbbmjTPac hR4L2tUhQjiRh+acATO6xKNxWeyqAfSioSQKO1vw1Oz3X7znVDrw8sIIOOpnv8UdVyiB nakFgJtr6YmtDoDCiZcLPBB6DB+mvDf2R/GSX/ycmB6JkoAov2DVdpf6p3aZ2BSw3ANf BlHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=iKhQzPbk7ciYhqSgiiFcChaeHyWDue/nZhrPbW5BGDs=; b=vFOvo2q9aNT6txVTc/Y/At2l1UFsJ2ygiWA4++3muDartLrxelqxDq06sdiX/zhgbW bH/3K8EPS7V8RUC8Y7p/6DKA0kYtLaLDIwEQFE3ZWZ9bzAD1IjnpQCn3JuAdBbP1v7lk gJFLr/XxxvwmovleeQdNgcqhAnAEgOZSS3InfCXgkQkGhcsUgNuLLWXWoa+YBGJcU0Yu 6Qh2lDnai8N3uLgkPJEKvzRdx4MfMhKuvRGfcvCjGMop/Gy1VtY5acvx+WlrCerEEW4/ dwzPIgLZHXAtfn0as2gj7HbdQO9WR1D917COELR/6ZdENfGX6ei0IYd7YRu0iPo+SYV8 iHMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 60si533146plf.398.2019.07.04.00.01.17; Thu, 04 Jul 2019 00:01:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725945AbfGDHBN (ORCPT + 99 others); Thu, 4 Jul 2019 03:01:13 -0400 Received: from mga02.intel.com ([134.134.136.20]:51103 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725879AbfGDHBM (ORCPT ); Thu, 4 Jul 2019 03:01:12 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jul 2019 00:01:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,449,1557212400"; d="scan'208";a="169369174" Received: from ingas-nuc1.sea.intel.com ([10.254.86.21]) by orsmga006.jf.intel.com with ESMTP; 04 Jul 2019 00:01:12 -0700 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: johan.hedberg@gmail.com, luiz.dentz@gmail.com, Inga Stotland Subject: [PATCH BlueZ] emulator: Fix condition check in btdev_create() Date: Thu, 4 Jul 2019 00:01:10 -0700 Message-Id: <20190704070110.13815-1-inga.stotland@intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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