Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13426750ybl; Sun, 29 Dec 2019 11:36:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxeOInfha5x+iDpRdkdmck/QWLKSIfqcMiJF/SLFENTjjv7gwR1IyZkJPSXdmqk0/kTJI4J X-Received: by 2002:a05:6830:18ed:: with SMTP id d13mr5282540otf.208.1577648187181; Sun, 29 Dec 2019 11:36:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577648187; cv=none; d=google.com; s=arc-20160816; b=OoQWLowkw8X1VBo+a00rFKgolltyBFtsXt9QrucS7QNVteK8HL27qH2sjTO1xC1S4R hKiW0mFEVEYtAl4PLz5RHal8HtKBYgG6eCMtlc75j/CMbRv4AqZOqi7APEaO5p3Y5E4E 2bAx8k3nT+YR67/ULvmgWJQ8PoOz1fUX9YdZ39auj6udLIH+MgDtJzSIP7R/qkvaHiXT e03BqJzqDZG2WIRVhyBmP9j+XY3qYNlY8+jjifWFlFJDre86OUSQ0R8bJAL6T/8QQvE0 tGHALA4Yj8eLB2p2ASybWgQg0/HKv6IsaknbD9FuA5O09b68qndF6+TDqxSnfa+RaIsz wx3A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vIFg9Gf5CTBEvbUhd+3lI8MuRsIezlHFk4jE27Xo7WY=; b=xi69FEPQw23gLSb3PkwXbQUjhH6Bf5dbUESsGEIRTj/b7StOlLCCYGVQ+RTcKyQ+s4 9Gv5i4bzdpxlCLQeBUxORJxVuH36mIQAI4ZJKKkPHnms68PWTQ5/E4g7yRIswEpQn8yk 2hYfL2BWVKpgt6E6ved6+mlGAgIcUxkcQmnvb/yk84iGboFTd+LJeH4xsiQNfsATZVHl NvxhmPUWSm3+zJyXB+xDlqS+PUgnoRkZjOff+f4Pcfv0VbyMvEVdaj9bb+7CfP0LuErl 7zL2A9S57YqELUyBGEfQF9Ouvo8vEuuCb+rdDSbAK0xztmaf3MBQaYWx7QJrQNjjq50x KfDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2ldP9uPj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si22163896otq.238.2019.12.29.11.36.16; Sun, 29 Dec 2019 11:36:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@kernel.org header.s=default header.b=2ldP9uPj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729050AbfL2Ra4 (ORCPT + 99 others); Sun, 29 Dec 2019 12:30:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:57398 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729039AbfL2Rav (ORCPT ); Sun, 29 Dec 2019 12:30:51 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 25B3D207FD; Sun, 29 Dec 2019 17:30:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640650; bh=jnlXGHJarNhgCCIlGpMbq+ekRLFn7DyckUxYb1beU54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2ldP9uPjTRfpH6LBEQEi7Zu2eTDvGc6d1ZpvPgetI0rJCZAPdYPjh91Z8aeSgQBzy fI3/3DA1xG6yqbpGg5yDLDSPM9gE98mUrPJznCSf0ZM6pww3I2ZTSrQMxA1ggwEqar 7VywO6+3i2sO0l8XIuK1Oi5wLVwpJJ6TLiFaN2UI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ben Dooks , Marcel Holtmann , Sasha Levin Subject: [PATCH 4.19 081/219] Bluetooth: missed cpu_to_le16 conversion in hci_init4_req Date: Sun, 29 Dec 2019 18:18:03 +0100 Message-Id: <20191229162517.892728927@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ben Dooks (Codethink) [ Upstream commit 727ea61a5028f8ac96f75ab34cb1b56e63fd9227 ] It looks like in hci_init4_req() the request is being initialised from cpu-endian data but the packet is specified to be little-endian. This causes an warning from sparse due to __le16 to u16 conversion. Fix this by using cpu_to_le16() on the two fields in the packet. net/bluetooth/hci_core.c:845:27: warning: incorrect type in assignment (different base types) net/bluetooth/hci_core.c:845:27: expected restricted __le16 [usertype] tx_len net/bluetooth/hci_core.c:845:27: got unsigned short [usertype] le_max_tx_len net/bluetooth/hci_core.c:846:28: warning: incorrect type in assignment (different base types) net/bluetooth/hci_core.c:846:28: expected restricted __le16 [usertype] tx_time net/bluetooth/hci_core.c:846:28: got unsigned short [usertype] le_max_tx_time Signed-off-by: Ben Dooks Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- 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 5afd67ef797a..e0de9a609265 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -841,8 +841,8 @@ static int hci_init4_req(struct hci_request *req, unsigned long opt) if (hdev->le_features[0] & HCI_LE_DATA_LEN_EXT) { struct hci_cp_le_write_def_data_len cp; - cp.tx_len = hdev->le_max_tx_len; - cp.tx_time = hdev->le_max_tx_time; + cp.tx_len = cpu_to_le16(hdev->le_max_tx_len); + cp.tx_time = cpu_to_le16(hdev->le_max_tx_time); hci_req_add(req, HCI_OP_LE_WRITE_DEF_DATA_LEN, sizeof(cp), &cp); } -- 2.20.1