Commit 0be0debe authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman
Browse files

staging: mt7621-pinctrl: init *map to NULL for correct memory assignation



pinctrl_utils_reserve_map() calls krealloc() on *map. Because of this
*map need to be initialized to NULL before calling it.

Fixes: 62b6215c ("staging: mt7621-pinctrl: make use of pinctrl_utils_reserve_map")
Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 00fee002
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -88,6 +88,7 @@ static int rt2880_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrldev,
	for_each_node_with_property(np_config, "group")
	for_each_node_with_property(np_config, "group")
		ngroups++;
		ngroups++;


	*map = NULL;
	ret = pinctrl_utils_reserve_map(pctrldev, map, &reserved_maps,
	ret = pinctrl_utils_reserve_map(pctrldev, map, &reserved_maps,
					num_maps, ngroups);
					num_maps, ngroups);
	if (ret) {
	if (ret) {