Merge "msm: ipa: return the wifi stats when reset is set"

This commit is contained in:
Linux Build Service Account 2018-01-24 09:12:48 -08:00 committed by Gerrit - the friendly Code Review server
commit 3f7d1f35f5
2 changed files with 10 additions and 12 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -2807,7 +2807,8 @@ static int rmnet_ipa_query_tethering_stats_wifi(
if (rc) {
kfree(sap_stats);
return rc;
} else if (reset) {
} else if (data == NULL) {
IPAWANDBG("only reset wlan stats\n");
kfree(sap_stats);
return 0;
}
@ -2880,6 +2881,7 @@ int rmnet_ipa_query_tethering_stats_modem(
kfree(resp);
return rc;
} else if (data == NULL) {
IPAWANDBG("only reset modem stats\n");
kfree(req);
kfree(resp);
return 0;
@ -3074,11 +3076,8 @@ int rmnet_ipa_query_tethering_stats_all(
int rmnet_ipa_reset_tethering_stats(struct wan_ioctl_reset_tether_stats *data)
{
enum ipa_upstream_type upstream_type;
struct wan_ioctl_query_tether_stats tether_stats;
int rc = 0;
memset(&tether_stats, 0, sizeof(struct wan_ioctl_query_tether_stats));
/* prevent string buffer overflows */
data->upstreamIface[IFNAMSIZ-1] = '\0';
@ -3099,7 +3098,7 @@ int rmnet_ipa_reset_tethering_stats(struct wan_ioctl_reset_tether_stats *data)
} else {
IPAWANDBG(" reset modem-backhaul stats\n");
rc = rmnet_ipa_query_tethering_stats_modem(
&tether_stats, true);
NULL, true);
if (rc) {
IPAWANERR("reset MODEM stats failed\n");
return rc;

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -2953,7 +2953,8 @@ static int rmnet_ipa3_query_tethering_stats_wifi(
IPAWANERR("can't get ipa3_get_wlan_stats\n");
kfree(sap_stats);
return rc;
} else if (reset) {
} else if (data == NULL) {
IPAWANDBG("only reset wlan stats\n");
kfree(sap_stats);
return 0;
}
@ -3024,6 +3025,7 @@ static int rmnet_ipa3_query_tethering_stats_modem(
kfree(resp);
return rc;
} else if (data == NULL) {
IPAWANDBG("only reset modem stats\n");
kfree(req);
kfree(resp);
return 0;
@ -3218,11 +3220,8 @@ int rmnet_ipa3_query_tethering_stats_all(
int rmnet_ipa3_reset_tethering_stats(struct wan_ioctl_reset_tether_stats *data)
{
enum ipa_upstream_type upstream_type;
struct wan_ioctl_query_tether_stats tether_stats;
int rc = 0;
memset(&tether_stats, 0, sizeof(struct wan_ioctl_query_tether_stats));
/* prevent string buffer overflows */
data->upstreamIface[IFNAMSIZ-1] = '\0';
@ -3243,7 +3242,7 @@ int rmnet_ipa3_reset_tethering_stats(struct wan_ioctl_reset_tether_stats *data)
} else {
IPAWANERR(" reset modem-backhaul stats\n");
rc = rmnet_ipa3_query_tethering_stats_modem(
&tether_stats, true);
NULL, true);
if (rc) {
IPAWANERR("reset MODEM stats failed\n");
return rc;