Merge "msm: ipa: Return error if inited and disconnect flag is set"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
c2c52bff46
@@ -4982,7 +4982,7 @@ EXPORT_SYMBOL(ipa3_wwan_platform_driver_register);
|
|||||||
int rmnet_ipa3_query_per_client_stats_v2(
|
int rmnet_ipa3_query_per_client_stats_v2(
|
||||||
struct wan_ioctl_query_per_client_stats *data)
|
struct wan_ioctl_query_per_client_stats *data)
|
||||||
{
|
{
|
||||||
int lan_clnt_idx, i, j;
|
int lan_clnt_idx, i, j, result = 1;
|
||||||
struct ipa_lan_client *lan_client = NULL;
|
struct ipa_lan_client *lan_client = NULL;
|
||||||
struct ipa_lan_client_cntr_index
|
struct ipa_lan_client_cntr_index
|
||||||
*lan_client_index = NULL;
|
*lan_client_index = NULL;
|
||||||
@@ -5033,6 +5033,19 @@ int rmnet_ipa3_query_per_client_stats_v2(
|
|||||||
mutex_unlock(&rmnet_ipa3_ctx->per_client_stats_guard);
|
mutex_unlock(&rmnet_ipa3_ctx->per_client_stats_guard);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
teth_ptr = &rmnet_ipa3_ctx->tether_device[data->device_type];
|
||||||
|
lan_client = &teth_ptr->lan_client[lan_clnt_idx];
|
||||||
|
/*
|
||||||
|
* Check if disconnect flag is set and
|
||||||
|
* and client is inited or not.
|
||||||
|
* if inited ignore resetting stats and return.
|
||||||
|
*/
|
||||||
|
if (data->disconnect_clnt && lan_client->inited) {
|
||||||
|
IPAWANERR("Client not inited.\n");
|
||||||
|
mutex_unlock(&rmnet_ipa3_ctx->per_client_stats_guard);
|
||||||
|
return -EAGAIN;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Max number of clients. */
|
/* Max number of clients. */
|
||||||
/* Check if disconnect flag is set and
|
/* Check if disconnect flag is set and
|
||||||
@@ -5078,9 +5091,9 @@ int rmnet_ipa3_query_per_client_stats_v2(
|
|||||||
lan_client_index[i].ul_cnt_idx,
|
lan_client_index[i].ul_cnt_idx,
|
||||||
lan_client_index[i].dl_cnt_idx);
|
lan_client_index[i].dl_cnt_idx);
|
||||||
memset(query, 0, sizeof(query_f));
|
memset(query, 0, sizeof(query_f));
|
||||||
ret = rmnet_ipa_get_hw_fnr_stats_v2(&lan_client_index[i],
|
result = rmnet_ipa_get_hw_fnr_stats_v2(&lan_client_index[i],
|
||||||
data, query);
|
data, query);
|
||||||
if (ret) {
|
if (result) {
|
||||||
IPAWANERR("Failed: Client type %d, idx %d\n",
|
IPAWANERR("Failed: Client type %d, idx %d\n",
|
||||||
data->device_type, i);
|
data->device_type, i);
|
||||||
kfree((void *)query->stats);
|
kfree((void *)query->stats);
|
||||||
@@ -5103,6 +5116,7 @@ int rmnet_ipa3_query_per_client_stats_v2(
|
|||||||
data->client_info[i].ipv4_rx_bytes);
|
data->client_info[i].ipv4_rx_bytes);
|
||||||
|
|
||||||
kfree((void *)query->stats);
|
kfree((void *)query->stats);
|
||||||
|
ret = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Legacy per-client stats */
|
/* Legacy per-client stats */
|
||||||
|
Reference in New Issue
Block a user