diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2011-10-11 15:08:21 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2011-11-11 05:50:57 -0500 |
commit | 171693292ec733ecb96734370ddfe0d9f73e920f (patch) | |
tree | 2c1a8d486c48103caadf02fd9b497069490d15df /drivers/net/wireless/ath | |
parent | 17380859a8fae40f7420d8fcc4be7a041a370659 (diff) |
ath6kl: Fix endpoint_stats debugfs buffer length calculation
The previous version did not really make much sense and the theoretical
maximum length would be a bit longer. Calculate the length more
accurately. In addition, there is no need to clear the buffer, so use
kmalloc instead of kzalloc. For bonus points, add the forgotten
cred_rpt_from_other value to the file.
Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/debug.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c index 7b1c9aee175e..dd377852a0ba 100644 --- a/drivers/net/wireless/ath/ath6kl/debug.c +++ b/drivers/net/wireless/ath/ath6kl/debug.c | |||
@@ -624,8 +624,9 @@ static ssize_t ath6kl_endpoint_stats_read(struct file *file, | |||
624 | unsigned int buf_len, len = 0; | 624 | unsigned int buf_len, len = 0; |
625 | ssize_t ret_cnt; | 625 | ssize_t ret_cnt; |
626 | 626 | ||
627 | buf_len = 1000 + ENDPOINT_MAX * 100; | 627 | buf_len = sizeof(struct htc_endpoint_stats) / sizeof(u32) * |
628 | buf = kzalloc(buf_len, GFP_KERNEL); | 628 | (25 + ENDPOINT_MAX * 11); |
629 | buf = kmalloc(buf_len, GFP_KERNEL); | ||
629 | if (!buf) | 630 | if (!buf) |
630 | return -ENOMEM; | 631 | return -ENOMEM; |
631 | 632 | ||
@@ -640,6 +641,7 @@ static ssize_t ath6kl_endpoint_stats_read(struct file *file, | |||
640 | EPSTAT(tx_dropped); | 641 | EPSTAT(tx_dropped); |
641 | EPSTAT(tx_cred_rpt); | 642 | EPSTAT(tx_cred_rpt); |
642 | EPSTAT(cred_rpt_from_rx); | 643 | EPSTAT(cred_rpt_from_rx); |
644 | EPSTAT(cred_rpt_from_other); | ||
643 | EPSTAT(cred_rpt_ep0); | 645 | EPSTAT(cred_rpt_ep0); |
644 | EPSTAT(cred_from_rx); | 646 | EPSTAT(cred_from_rx); |
645 | EPSTAT(cred_from_other); | 647 | EPSTAT(cred_from_other); |