From patchwork Fri Feb 10 20:27:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ryan Hsu X-Patchwork-Id: 9567455 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3C18760572 for ; Fri, 10 Feb 2017 20:27:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C8A82859A for ; Fri, 10 Feb 2017 20:27:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21422285C5; Fri, 10 Feb 2017 20:27:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E83C2859A for ; Fri, 10 Feb 2017 20:27:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753882AbdBJU15 (ORCPT ); Fri, 10 Feb 2017 15:27:57 -0500 Received: from wolverine02.qualcomm.com ([199.106.114.251]:45907 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753486AbdBJU14 (ORCPT ); Fri, 10 Feb 2017 15:27:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1486758476; x=1518294476; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=YFKYo3WtZKqOAdtkTJs5V38StWWnvGUNkDF+Qw5UGeY=; b=HoLubs51HrUL2c+/dCxcmCeOOI90vpAvHOBEoFdAWLu5zvPwlHQuqnvL CccSlpzqxngdKrdsSa5C+o9RMOgbXuYqdIusmivbgzIT9rG0avHdjk1zM mI4G4fk93K2hJsMrGdMpbGUc37wcodS1LgYU54ZeIYqEACScWb/nqTG2H g=; X-IronPort-AV: E=Sophos;i="5.35,142,1484035200"; d="scan'208";a="357298619" Received: from ironmsg05-lv.qualcomm.com ([10.47.202.182]) by wolverine02.qualcomm.com with ESMTP; 10 Feb 2017 12:27:50 -0800 X-IronPort-AV: E=McAfee;i="5800,7501,8435"; a="29785507" Received: from nalasexr01g.na.qualcomm.com ([10.49.56.53]) by ironmsg05-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 10 Feb 2017 12:27:50 -0800 Received: from ryanhsu-linux2.qualcomm.com (10.80.80.8) by NALASEXR01G.na.qualcomm.com (10.49.56.53) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Fri, 10 Feb 2017 12:27:49 -0800 From: To: , CC: Subject: [PATCH] ath10k: fix the garage chars in board file name creation Date: Fri, 10 Feb 2017 12:27:09 -0800 Message-ID: <1486758429-18665-1-git-send-email-ryanhsu@qca.qualcomm.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01E.na.qualcomm.com (10.85.0.31) To NALASEXR01G.na.qualcomm.com (10.49.56.53) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ryan Hsu 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 Signed-off-by: Ryan Hsu --- 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,