Linux-Wireless Archive on lore.kernel.org
 help / color / Atom feed
From: Maya Erez <merez@codeaurora.org>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: Dedy Lansky <dlansky@codeaurora.org>,
	linux-wireless@vger.kernel.org, wil6210@qti.qualcomm.com,
	Maya Erez <merez@codeaurora.org>
Subject: [PATCH 05/11] wil6210: fix printout in wil_read_pmccfg
Date: Sun, 16 Jun 2019 10:26:01 +0300
Message-ID: <1560669967-23706-6-git-send-email-merez@codeaurora.org> (raw)
In-Reply-To: <1560669967-23706-1-git-send-email-merez@codeaurora.org>

From: Dedy Lansky <dlansky@codeaurora.org>

Replace sprintf with snprintf which checks the destination buffer
size.

Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
---
 drivers/net/wireless/ath/wil6210/debugfs.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index 14778a1c..8eb6d49 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -976,9 +976,8 @@ static ssize_t wil_read_pmccfg(struct file *file, char __user *user_buf,
 	" - \"alloc <num descriptors> <descriptor_size>\" to allocate pmc\n"
 	" - \"free\" to free memory allocated for pmc\n";
 
-	sprintf(text, "Last command status: %d\n\n%s",
-		wil_pmc_last_cmd_status(wil),
-		help);
+	snprintf(text, sizeof(text), "Last command status: %d\n\n%s",
+		 wil_pmc_last_cmd_status(wil), help);
 
 	return simple_read_from_buffer(user_buf, count, ppos, text,
 				       strlen(text) + 1);
-- 
1.9.1


  parent reply index

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-16  7:25 [PATCH 00/11] wil6210 patches Maya Erez
2019-06-16  7:25 ` [PATCH 01/11] wil6210: do not reset FW in STA to P2P client interface switch Maya Erez
2019-06-27 17:51   ` Kalle Valo
2019-06-16  7:25 ` [PATCH 02/11] wil6210: enlarge Tx status ring size Maya Erez
2019-06-16  7:25 ` [PATCH 03/11] wil6210: increase the frequency of status ring hw tail update Maya Erez
2019-06-16  7:26 ` [PATCH 04/11] wil6210: Add support for setting RBUFCAP configuration Maya Erez
2019-06-16  7:26 ` Maya Erez [this message]
2019-06-16  7:26 ` [PATCH 06/11] wil6210: clear FW and ucode log address Maya Erez
2019-06-16  7:26 ` [PATCH 07/11] wil6210: update cid boundary check of wil_find_cid/_by_idx() Maya Erez
2019-06-16  7:26 ` [PATCH 08/11] wil6210: publish max_msdu_size to FW on BCAST ring Maya Erez
2019-06-16  7:26 ` [PATCH 09/11] wil6210: add support for reading multiple RFs temperature via debugfs Maya Erez
2019-06-16  7:26 ` [PATCH 10/11] wil6210: set WIL_WMI_CALL_GENERAL_TO_MS as wmi_call timeout Maya Erez
2019-06-16  7:26 ` [PATCH 11/11] wil6210: drop old event after " Maya Erez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1560669967-23706-6-git-send-email-merez@codeaurora.org \
    --to=merez@codeaurora.org \
    --cc=dlansky@codeaurora.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=wil6210@qti.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Wireless Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wireless/0 linux-wireless/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wireless linux-wireless/ https://lore.kernel.org/linux-wireless \
		linux-wireless@vger.kernel.org
	public-inbox-index linux-wireless

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-wireless


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git