lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230519214408.20984-1-minhuadotchen@gmail.com>
Date:   Sat, 20 May 2023 05:44:08 +0800
From:   Min-Hua Chen <minhuadotchen@...il.com>
To:     Marcel Holtmann <marcel@...tmann.org>,
        Johan Hedberg <johan.hedberg@...il.com>,
        Luiz Augusto von Dentz <luiz.dentz@...il.com>
Cc:     Min-Hua Chen <minhuadotchen@...il.com>,
        linux-bluetooth@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] Bluetooth: hci_mrvl: use correct __le16 type

Cast 0xffff to __le16 before comparing it with a __le16 type pkt
and fix the following sparse warnings:

drivers/bluetooth/hci_mrvl.c:170:23: sparse: warning:
restricted __le16 degrades to integer
drivers/bluetooth/hci_mrvl.c:203:23: sparse: warning:
restricted __le16 degrades to integer

Signed-off-by: Min-Hua Chen <minhuadotchen@...il.com>
---
 drivers/bluetooth/hci_mrvl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/hci_mrvl.c b/drivers/bluetooth/hci_mrvl.c
index e08222395772..91f63d2b0c02 100644
--- a/drivers/bluetooth/hci_mrvl.c
+++ b/drivers/bluetooth/hci_mrvl.c
@@ -167,7 +167,7 @@ static int mrvl_recv_fw_req(struct hci_dev *hdev, struct sk_buff *skb)
 	struct mrvl_data *mrvl = hu->priv;
 	int ret = 0;
 
-	if ((pkt->lhs ^ pkt->rhs) != 0xffff) {
+	if ((pkt->lhs ^ pkt->rhs) != cpu_to_le16(0xffff)) {
 		bt_dev_err(hdev, "Corrupted mrvl header");
 		mrvl_send_ack(hu, MRVL_NAK);
 		ret = -EINVAL;
@@ -200,7 +200,7 @@ static int mrvl_recv_chip_ver(struct hci_dev *hdev, struct sk_buff *skb)
 	u16 version = le16_to_cpu(pkt->lhs);
 	int ret = 0;
 
-	if ((pkt->lhs ^ pkt->rhs) != 0xffff) {
+	if ((pkt->lhs ^ pkt->rhs) != cpu_to_le16(0xffff)) {
 		bt_dev_err(hdev, "Corrupted mrvl header");
 		mrvl_send_ack(hu, MRVL_NAK);
 		ret = -EINVAL;
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ