From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 918E72572 for ; Tue, 18 Apr 2023 12:43:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5562C433D2; Tue, 18 Apr 2023 12:43:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1681821794; bh=aXSOuYvmTIaGUJwOusY2pcfU4RwwyLNCWcxY7NsZPKo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1SMM0m979i06sT+TsaU85umXYbMntrGbf2C0L8iveJ79TamqYCW9W1dpcHRTGmayt sZkO56i81URLI6629yX8GAjmh7MjxDVTNzVKzWWGYDCCVJ0lKy/iidrFsOI6C1gJG6 Hb7rIb4RYZ4RWFN94yM9mpQZoK25PMv4R2IMC1N4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sasha Finkelstein , Luiz Augusto von Dentz Subject: [PATCH 6.1 014/134] bluetooth: btbcm: Fix logic error in forming the board name. Date: Tue, 18 Apr 2023 14:21:10 +0200 Message-Id: <20230418120313.497009672@linuxfoundation.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230418120313.001025904@linuxfoundation.org> References: <20230418120313.001025904@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Sasha Finkelstein commit b76abe4648c1acc791a207e7c08d1719eb9f4ea8 upstream. 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: Signed-off-by: Sasha Finkelstein Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Greg Kroah-Hartman --- drivers/bluetooth/btbcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/bluetooth/btbcm.c +++ b/drivers/bluetooth/btbcm.c @@ -511,7 +511,7 @@ static const char *btbcm_get_board_name( 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] = '-'; }