[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230224-btbcm-wtf-v1-1-be717d728e56@gmail.com>
Date: Fri, 24 Feb 2023 12:59:31 +0100
From: Sasha Finkelstein via B4 Relay
<devnull+fnkl.kernel.gmail.com@...nel.org>
To: Marcel Holtmann <marcel@...tmann.org>,
Johan Hedberg <johan.hedberg@...il.com>,
Luiz Augusto von Dentz <luiz.dentz@...il.com>
Cc: linux-bluetooth@...r.kernel.org, stable@...r.kernel.org,
linux-kernel@...r.kernel.org,
Sasha Finkelstein <fnkl.kernel@...il.com>
Subject: [PATCH] bluetooth: btbcm: Fix logic error in forming the board
name.
From: Sasha Finkelstein <fnkl.kernel@...il.com>
This patch fixes an incorrect loop exit condition in code that replaces
'/' symbols in the board name. There might also be a memory corruption
issue here, but it is unlikely to be a real problem.
Signed-off-by: Sasha Finkelstein <fnkl.kernel@...il.com>
---
drivers/bluetooth/btbcm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c
index 3006e2a0f37e..43e98a598bd9 100644
--- a/drivers/bluetooth/btbcm.c
+++ b/drivers/bluetooth/btbcm.c
@@ -511,7 +511,7 @@ static const char *btbcm_get_board_name(struct device *dev)
len = strlen(tmp) + 1;
board_type = devm_kzalloc(dev, len, GFP_KERNEL);
strscpy(board_type, tmp, len);
- for (i = 0; i < board_type[i]; i++) {
+ for (i = 0; i < len; i++) {
if (board_type[i] == '/')
board_type[i] = '-';
}
---
base-commit: c9c3395d5e3dcc6daee66c6908354d47bf98cb0c
change-id: 20230224-btbcm-wtf-ff32fed3e930
Best regards,
--
Sasha Finkelstein <fnkl.kernel@...il.com>
Powered by blists - more mailing lists