diff options
author | Dedy Lansky <dlansky@codeaurora.org> | 2019-06-16 03:26:01 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-06-27 13:50:10 -0400 |
commit | dedec35b40195f56d16386eea51c8255bf034dba (patch) | |
tree | a3ac8e392eba70c982ffc12c6ee4956a68f7743d /drivers/net/wireless | |
parent | c5b3a6582b1e9fad0fb0b8658855387c0cbcc576 (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')
-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, | |||
940 | " - \"alloc <num descriptors> <descriptor_size>\" to allocate pmc\n" | 940 | " - \"alloc <num descriptors> <descriptor_size>\" to allocate pmc\n" |
941 | " - \"free\" to free memory allocated for pmc\n"; | 941 | " - \"free\" to free memory allocated for pmc\n"; |
942 | 942 | ||
943 | sprintf(text, "Last command status: %d\n\n%s", | 943 | snprintf(text, sizeof(text), "Last command status: %d\n\n%s", |
944 | wil_pmc_last_cmd_status(wil), | 944 | wil_pmc_last_cmd_status(wil), help); |
945 | help); | ||
946 | 945 | ||
947 | return simple_read_from_buffer(user_buf, count, ppos, text, | 946 | return simple_read_from_buffer(user_buf, count, ppos, text, |
948 | strlen(text) + 1); | 947 | strlen(text) + 1); |