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

Commit f9778125 authored by John Zhao's avatar John Zhao Committed by Gerrit - the friendly Code Review server
Browse files

lpm-stats: cleanup lpm stats processing sanity wrapping



during list_for_each_entry_reverse iteration, cleanup_stats
recursively on current operated stats node could result it
will be freed at the end of that cleanup_stats progress.
De-referencing it again should not happen.

CRs-Fixed: 2182622
Change-Id: Icf837b0aa796fed5fe1721f9fe66fd0dd36ccfd7
Signed-off-by: default avatarJohn Zhao <yuankuiz@codeaurora.org>
parent c811a00b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2016, 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
@@ -685,8 +685,10 @@ static void cleanup_stats(struct lpm_stats *stats)

	centry = &stats->child;
	list_for_each_entry_reverse(pos, centry, sibling) {
		if (!list_empty(&pos->child))
		if (!list_empty(&pos->child)) {
			cleanup_stats(pos);
			continue;
		}

		list_del_init(&pos->child);