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: 9567469 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 BD05A60572 for ; Fri, 10 Feb 2017 20:28:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD7BA2859A for ; Fri, 10 Feb 2017 20:28:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A222A285C5; Fri, 10 Feb 2017 20:28:21 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 490242859A for ; Fri, 10 Feb 2017 20:28:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=fu7dwPIaQVT77YRRvZBNB0PZZSMbW4xMOa6QT06Efk8=; b=oRS/rPk+uJxBxK hEDgiBVaEHzTxjLbuXNxmQwDTi7LD5bxtD0uE3T/fEl3MPfteWl+XNyy5N9rnLqNc4QA1GmISlWKG oeDlF6/EO14In4H5mN2N+/q6SXg3+CNDZnT6/orkb+R3nVE3NgiyPxs8UfsjKWlDrenhNS4kMECbg OcJ6uww6ba8ZgNED6hVNL1LjbUXV0GzAfPOTcvKXQrnhfPtRp3B8UgkUGYwwGk6uPxpUfGOjxkNjZ +TentrsRgiJ3QNNwYaBaZE0ghE4lrox4zf5sFhsg0YcJ60vDASUIBn96HxPjtoNNYItkh/QTGv/sg Hrdk+HiDe2sBh48RAz3A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ccHnj-0001tB-G8; Fri, 10 Feb 2017 20:28:15 +0000 Received: from wolverine01.qualcomm.com ([199.106.114.254]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ccHnf-0001rc-Qm for ath10k@lists.infradead.org; Fri, 10 Feb 2017 20:28:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1486758491; x=1518294491; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=YFKYo3WtZKqOAdtkTJs5V38StWWnvGUNkDF+Qw5UGeY=; b=rh1SZL6qLYtxHlnUpryhqkXwug0Il9jaNJn3kNVo1H7T7x3/p9rboh+7 h8drbYBCiMspOpQVHzgSmywdilFr4QcRjCK5p8iQWjmsZAMb1HO3Ht/uG EuzaP6xJiVs8HHisr8O8+isghAe7CJredoB/PvVBqJctOaUaZewQ5tyf/ U=; X-IronPort-AV: E=Sophos;i="5.35,142,1484035200"; d="scan'208";a="261898452" Received: from ironmsg05-lv.qualcomm.com ([10.47.202.182]) by wolverine01.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: , 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) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170210_122811_982222_83180555 X-CRM114-Status: UNSURE ( 7.34 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ryanhsu@qca.qualcomm.com Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.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,