Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c87f188c authored by Mohammed Javid's avatar Mohammed Javid Committed by Swetha Chikkaboraiah
Browse files

msm: ipa: Fix to check only reset IPA stats can have data as NULL



Only reset IPA stats can have tether_stat
data as NULL. Query of of tether stat without
allocating memory for structure
wan_ioctl_query_tether_stats should fail.

Change-Id: Iab0fa98ffdcb2b32d75f4e8cb88f250002d2a787
Acked-by: default avatarPooja Kumari <kumarip@qti.qualcomm.com>
Signed-off-by: default avatarMohammed Javid <mjavid@codeaurora.org>
parent e8755fbb
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -2841,8 +2841,9 @@ static int rmnet_ipa_query_tethering_stats_modem(
		/* prevent string buffer overflows */
		/* prevent string buffer overflows */
		data->upstreamIface[IFNAMSIZ-1] = '\0';
		data->upstreamIface[IFNAMSIZ-1] = '\0';
		data->tetherIface[IFNAMSIZ-1] = '\0';
		data->tetherIface[IFNAMSIZ-1] = '\0';
	} else if (reset) {
	} else if (!reset) {
		/* Data can be NULL for reset stats, checking reset != False */
		/* only reset can have data == NULL*/
		IPAWANERR("query without allocate tether_stats strucutre\n");
		return -EINVAL;
		return -EINVAL;
	}
	}


+3 −2
Original line number Original line Diff line number Diff line
@@ -3272,8 +3272,9 @@ static int rmnet_ipa3_query_tethering_stats_modem(
		/* prevent string buffer overflows */
		/* prevent string buffer overflows */
		data->upstreamIface[IFNAMSIZ-1] = '\0';
		data->upstreamIface[IFNAMSIZ-1] = '\0';
		data->tetherIface[IFNAMSIZ-1] = '\0';
		data->tetherIface[IFNAMSIZ-1] = '\0';
	} else if (reset) {
	} else if (!reset) {
		/* Data can be NULL for reset stats, checking reset != False */
		/* only reset can have data == NULL */
		IPAWANERR("query without allocate tether_stats strucutre\n");
		return -EINVAL;
		return -EINVAL;
	}
	}