summaryrefslogtreecommitdiff
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorSasha Finkelstein <fnkl.kernel@gmail.com>2023-03-10 13:28:42 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-04-10 20:23:15 +0300
commitb76abe4648c1acc791a207e7c08d1719eb9f4ea8 (patch)
tree6d0afb0ec8de98ed352c993c7b02ff3c87b44dc6 /drivers/bluetooth
parent73f7b171b7c09139eb3c6a5677c200dc1be5f318 (diff)
downloadlinux-b76abe4648c1acc791a207e7c08d1719eb9f4ea8.tar.xz
bluetooth: btbcm: Fix logic error in forming the board name.
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. Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/btbcm.c2
1 files changed, 1 insertions, 1 deletions
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] = '-';
}