Skip to content

Commit

Permalink
bluetooth: btbcm: Fix logic error in forming the board name.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sasha Finkelstein authored and Luiz Augusto von Dentz committed Apr 7, 2023
1 parent 6cc6aae commit 8507291
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/bluetooth/btbcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] = '-';
}
Expand Down

0 comments on commit 8507291

Please sign in to comment.