[PATCH] ath10k: fix the garage chars in board file name creation

Subsystems: atheros ath generic utilities, qualcomm atheros ath10k wireless driver, the rest

STALE3456d

2 messages, 2 authors, 2017-02-14 · open the first message on its own page

[PATCH] ath10k: fix the garage chars in board file name creation

From: <hidden>
Date: 2017-02-10 20:27:56

From: Ryan Hsu <redacted>

The variant[] string will be valid only if the bdf_ext is set.

The string memory needs to be null-terminated to avoid the undefined garbage
appended by the subsequent board file name creation.

ath10k_pci 0000:04:00.0: failed to fetch board data for
"bus=pci,vendor=168c,device=003e,subsystem-vendor=168c,subsystem-device=3363��P�����"
from ath10k/QCA6174/hw3.0/board-2.bin

Fixes: f2593cb1b291 ("ath10k: Search SMBIOS for OEM board file extension")
Reported-by: Kalle Valo <redacted>
Signed-off-by: Ryan Hsu <redacted>
---
 drivers/net/wireless/ath/ath10k/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index c27e7ea..014a87e 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1122,7 +1122,7 @@ static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
 					 size_t name_len)
 {
 	/* strlen(',variant=') + strlen(ar->id.bdf_ext) */
-	char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH];
+	char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = { 0 };
 
 	if (ar->id.bmi_ids_valid) {
 		scnprintf(name, name_len,
-- 
1.9.1

Re: ath10k: fix the garage chars in board file name creation

From: Kalle Valo <hidden>
Date: 2017-02-14 17:57:20

Ryan Hsu [off-list ref] wrote:
From: Ryan Hsu <redacted>

The variant[] string will be valid only if the bdf_ext is set.

The string memory needs to be null-terminated to avoid the undefined garbage
appended by the subsequent board file name creation.

ath10k_pci 0000:04:00.0: failed to fetch board data for
"bus=pci,vendor=168c,device=003e,subsystem-vendor=168c,subsystem-device=3363��P�����"
from ath10k/QCA6174/hw3.0/board-2.bin

Fixes: f2593cb1b291 ("ath10k: Search SMBIOS for OEM board file extension")
Reported-by: Kalle Valo <redacted>
Signed-off-by: Ryan Hsu <redacted>
Patch applied to ath-next branch of ath.git, thanks.

a532293fcba4 ath10k: fix the garage chars in board file name creation

-- 
https://patchwork.kernel.org/patch/9567469/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help