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

Commit 7e46eab5 authored by Prasad Sodagudi's avatar Prasad Sodagudi Committed by Gerrit - the friendly Code Review server
Browse files

pinctrl: msm: Free mapping table entries of PIN_MAP_TYPE_MUX_GROUP type



Currently when pinctrl mapping table entries are freed, they are always
checked against PIN_MAP_TYPE_MUX_GROUP type. The bug in existing logic
causes only first entry in the mapping table to be checked against
PIN_MAP_TYPE_MUX_GROUP type. However at time of allocation, entry
corresponding to PIN_MAP_TYPE_MUX_GROUP is allocated as the second
entry. Thus the PIN_MAP_TYPE_MUX_GROUP allocation is never freed,
leading to memory leak.

CRs-Fixed: 802999
Change-Id: Ibb38c468a8b4e45a84dc533f42736662edc994a1
Signed-off-by: default avatarNeeraj Singh <sneeraj@codeaurora.org>
Signed-off-by: default avatarPrasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: default avatarHanumant Singh <hanumant@codeaurora.org>
parent 339c3875
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2015, 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
@@ -364,7 +364,7 @@ static void msm_dt_free_map(struct pinctrl_dev *pctldev,
	for (idx = 0; idx < num_maps; idx++) {
		if (map[idx].type == PIN_MAP_TYPE_CONFIGS_GROUP)
			kfree(map[idx].data.configs.configs);
		else if (map->type == PIN_MAP_TYPE_MUX_GROUP)
		else if (map[idx].type == PIN_MAP_TYPE_MUX_GROUP)
			kfree(map[idx].data.mux.function);
	};