ipa: Fix debugfs tethering stats print

Currently the ipa_debugfs_print_tethering_stats()
prints values from zeroed buffer.

The ipa_get_teth_stats() has to be called only once,
and ipa_query_teth_stats() to fill the buffer.

Change-Id: I72e6db3c9f2c342e8b635341eee06795b2be9d67
Signed-off-by: Ilia Lin <ilialin@codeaurora.org>
This commit is contained in:
Ilia Lin 2020-08-06 15:25:30 +03:00
commit 6cdcc3b5ab

View file

@ -1971,6 +1971,14 @@ static ssize_t ipa_debugfs_print_tethering_stats(struct file *file,
return -ENOMEM;
mutex_lock(&ipa3_ctx->lock);
res = ipa_get_teth_stats();
if (res) {
mutex_unlock(&ipa3_ctx->lock);
kfree(out);
return res;
}
for (i = 0; i < IPA_CLIENT_MAX; i++) {
int ep_idx = ipa3_get_ep_mapping(i);
@ -1987,7 +1995,7 @@ static ssize_t ipa_debugfs_print_tethering_stats(struct file *file,
(1 << ep_idx)))
continue;
res = ipa_get_teth_stats();
res = ipa_query_teth_stats(i, out, false);
if (res) {
mutex_unlock(&ipa3_ctx->lock);
kfree(out);