summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/wil6210
diff options
context:
space:
mode:
authorDedy Lansky <dlansky@codeaurora.org>2019-06-16 10:26:01 +0300
committerKalle Valo <kvalo@codeaurora.org>2019-06-27 20:50:10 +0300
commitdedec35b40195f56d16386eea51c8255bf034dba (patch)
treea3ac8e392eba70c982ffc12c6ee4956a68f7743d /drivers/net/wireless/ath/wil6210
parentc5b3a6582b1e9fad0fb0b8658855387c0cbcc576 (diff)
wil6210: fix printout in wil_read_pmccfg
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> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210')
-rw-r--r--drivers/net/wireless/ath/wil6210/debugfs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index cfeed928b2ce..8ac53fb2bb59 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -940,9 +940,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);