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

Commit 20e37341 authored by Mohammed Javid's avatar Mohammed Javid Committed by Gerrit - the friendly Code Review server
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 7b8551f2
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
/* 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
@@ -2652,8 +2652,9 @@ int rmnet_ipa_query_tethering_stats(struct wan_ioctl_query_tether_stats *data,
		/* prevent string buffer overflows */
		data->upstreamIface[IFNAMSIZ-1] = '\0';
		data->tetherIface[IFNAMSIZ-1] = '\0';
	} else if (reset != false) {
		/* Data can be NULL for reset stats, checking reset != False */
	} else if (reset == false) {
		/* only reset can have data == NULL*/
		IPAWANERR("query without allocate tether_stats strucutre\n");
		return -EINVAL;
	}

+4 −3
Original line number Diff line number Diff line
/* 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
@@ -2810,8 +2810,9 @@ int rmnet_ipa3_query_tethering_stats(struct wan_ioctl_query_tether_stats *data,
		/* prevent string buffer overflows */
		data->upstreamIface[IFNAMSIZ-1] = '\0';
		data->tetherIface[IFNAMSIZ-1] = '\0';
	} else if (reset != false) {
		/* Data can be NULL for reset stats, checking reset != False */
	} else if (reset == false) {
		/* only reset can have data == NULL */
		IPAWANERR("query without allocate tether_stats strucutre\n");
		return -EINVAL;
	}