diff options
author | Dedy Lansky <dlansky@codeaurora.org> | 2019-06-16 10:26:01 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-06-27 20:50:10 +0300 |
commit | dedec35b40195f56d16386eea51c8255bf034dba (patch) | |
tree | a3ac8e392eba70c982ffc12c6ee4956a68f7743d | |
parent | c5b3a6582b1e9fad0fb0b8658855387c0cbcc576 (diff) | |
download | linux-dedec35b40195f56d16386eea51c8255bf034dba.tar.bz2 |
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>
-rw-r--r-- | drivers/net/wireless/ath/wil6210/debugfs.c | 5 |
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); |