summaryrefslogtreecommitdiffstats
path: root/drivers/staging/mt7621-pinctrl
diff options
context:
space:
mode:
authorSergio Paracuellos <sergio.paracuellos@gmail.com>2018-07-09 06:52:45 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-10 12:36:28 +0200
commit0be0debe4a8a6ff0c7b79ca7c16a656204651a69 (patch)
tree612cb07813db115ac032ceb672c055fd49629075 /drivers/staging/mt7621-pinctrl
parent00fee00245e2f2d0ce9376ced63c0f20c406aa62 (diff)
downloadlinux-0be0debe4a8a6ff0c7b79ca7c16a656204651a69.tar.gz
linux-0be0debe4a8a6ff0c7b79ca7c16a656204651a69.tar.bz2
linux-0be0debe4a8a6ff0c7b79ca7c16a656204651a69.zip
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: 62b6215c11ea ("staging: mt7621-pinctrl: make use of pinctrl_utils_reserve_map") Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/mt7621-pinctrl')
-rw-r--r--drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
index 70259425e7e9..c223ecb3ad3f 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
@@ -88,6 +88,7 @@ static int rt2880_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrldev,
for_each_node_with_property(np_config, "group")
ngroups++;
+ *map = NULL;
ret = pinctrl_utils_reserve_map(pctrldev, map, &reserved_maps,
num_maps, ngroups);
if (ret) {