Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp606800ybh; Wed, 11 Mar 2020 07:20:07 -0700 (PDT) X-Google-Smtp-Source: ADFU+vundqhdAxtf66uWvkoXqpGcQlC/VrDPrzLxY7jdPZPjC0mzQhYejWE5s5Fqx+yVFXKhLSw6 X-Received: by 2002:aca:5ed4:: with SMTP id s203mr2222130oib.102.1583936407764; Wed, 11 Mar 2020 07:20:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583936407; cv=none; d=google.com; s=arc-20160816; b=q69gXvslcy6He3EjDu6OCNX3rMsWci4mRc/F2E6o2VmUAv2wqgTPA4X6xDvXXeczRG Urz5XEBI7pY2IqsFthCUiHG06sHD1RvlIFkmhsIciLzVXs/+xfLWIrmgtIgH5X3hs35U aiNX5ShWo5qzbAxz0inczc6tWSbZSox0qgHTNt7Pro6K2WGxaCycBgrqPEYSSxCvahRx TRR0bFs6xa1cbQdyQBYLE0eY9ayImAiOem3YolrmHNrPM4AwnGe8JUhOd1L1atmlC6+K iMyJrcRyCt3tQx1UUi2tV8+VpdzXwFo8JsYcbE9tEZMzUNG6zXejXCHgQTz6MqAF0Mit 8n/g== 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:dkim-signature; bh=KgINo+FmXFS9/VCjRJK2I8u1n1ONpikVJE8dHnJjrFY=; b=XCTf2tyY8Zawxc6bTlDZ5w15NjmRtgjCpmw10xk3LKm4p68Kt9QrnjMVUldLynTMY6 3cOAyYr6O3cYf1386y5uPTiMc/ktosSyL1s95JmZa2ykX8gKnCMK1aNn2BqLTNWAojPR TJ+OjZqb8c8FRYQntUwF9ppXxPIBHPmcLP78LKZ8y2QN7A2/AH3QTCkM4fzw0CsKJLwP XvVSadhF2cNPr2/MdnamqRnFQRV80fujCsYmQkpvnB007Usl5rjwXHj0MCc4R/cCA+TD 6m74Z/5PMND0D4axYeNchIcCVt/99ePBXE/uhBPnp3syODkuw/Rujdt/0cxal2Lo47Sj TXeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OLAXECts; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t132si1298854oih.173.2020.03.11.07.19.52; Wed, 11 Mar 2020 07:20:07 -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; dkim=pass header.i=@chromium.org header.s=google header.b=OLAXECts; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729559AbgCKOTH (ORCPT + 99 others); Wed, 11 Mar 2020 10:19:07 -0400 Received: from mail-vk1-f195.google.com ([209.85.221.195]:41777 "EHLO mail-vk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729838AbgCKOTG (ORCPT ); Wed, 11 Mar 2020 10:19:06 -0400 Received: by mail-vk1-f195.google.com with SMTP id q8so567616vka.8 for ; Wed, 11 Mar 2020 07:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KgINo+FmXFS9/VCjRJK2I8u1n1ONpikVJE8dHnJjrFY=; b=OLAXECtsRVVMsBgBTGT2DVPQfugQKOnFF/7EgpqgzJQinX+oVvta1WPPTn3Uc8WWtN qHsFQJQEhfVVqRR3yfHNUFTTF5XScMTPw7rLQVJfB2CqeMwrMLcuhaPlm3x+jvGKWIk2 QjkBILSMqXYvmYxxdjrfsSdjyEqEJYt+9Ucgg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KgINo+FmXFS9/VCjRJK2I8u1n1ONpikVJE8dHnJjrFY=; b=Sbe3H5RYroPbjozZVKIBk0hJvo+c+bTrkOPvJr+Ba+kOZm1roHUvhjWzYPz6tnmCzu stPyMQeR91n6bNedEnuK/JAEXgRl58kjPBR6FqdcRWvSrS8LO1cCwh1XSsgPtNGqIfF4 qwW4y+lnRjJL+wZmQUhzEyiDw4Z2vHhQEQOkQcY0yNOAlrgGfOjbta7/zAyYdpo2R+Or v4DuJfJPklmGg7fuNGTISYG1A48P0h8I0qC9DIK14TgkWjR/nCINl/zaHWIOJY/2kFsl ZYi+H/G//+FFP+4WTF+DoDYUVZoppimfOO6e7/klAVvCOjb6/s0GlFd/SbZikqNEevi9 sqqA== X-Gm-Message-State: ANhLgQ0LEj34FgjdFy/iMLVl0B2UYlfa2qWzj2f7RzJjle2iS53JonDq tK7+1mRw66t3slPMPLYwCeN5+ZpbLP8= X-Received: by 2002:a05:6122:1184:: with SMTP id x4mr1976244vkn.62.1583936343403; Wed, 11 Mar 2020 07:19:03 -0700 (PDT) Received: from alain.c.googlers.com.com (57.152.190.35.bc.googleusercontent.com. [35.190.152.57]) by smtp.gmail.com with ESMTPSA id 4sm12484428vsk.16.2020.03.11.07.19.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2020 07:19:02 -0700 (PDT) From: Alain Michaud To: linux-bluetooth@vger.kernel.org Cc: Alain Michaud Subject: [PATCH v1] bluetooth: fix off by one in err_data_reporting cmd masks. Date: Wed, 11 Mar 2020 14:18:57 +0000 Message-Id: <20200311141857.197369-1-alainm@chromium.org> X-Mailer: git-send-email 2.25.1.481.gfbce0eb801-goog 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 change fixes the off by one error in the erroneous command bit masks which can lead to the erroneous data commands being sent to a controller that doesn't support them. Signed-off-by: Alain Michaud --- net/bluetooth/hci_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 9ce98762559b..196edc039b8e 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -603,7 +603,7 @@ static int hci_init3_req(struct hci_request *req, unsigned long opt) if (hdev->commands[8] & 0x01) hci_req_add(req, HCI_OP_READ_PAGE_SCAN_ACTIVITY, 0, NULL); - if (hdev->commands[18] & 0x02) + if (hdev->commands[18] & 0x04) hci_req_add(req, HCI_OP_READ_DEF_ERR_DATA_REPORTING, 0, NULL); /* Some older Broadcom based Bluetooth 1.2 controllers do not @@ -844,7 +844,7 @@ static int hci_init4_req(struct hci_request *req, unsigned long opt) /* Set erroneous data reporting if supported to the wideband speech * setting value */ - if (hdev->commands[18] & 0x04) { + if (hdev->commands[18] & 0x08) { bool enabled = hci_dev_test_flag(hdev, HCI_WIDEBAND_SPEECH_ENABLED); -- 2.25.1.481.gfbce0eb801-goog