pinctrl: samsung: drop pin banks references on error paths
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Tue, 11 Jan 2022 20:13:59 +0000 (21:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:39:51 +0000 (14:39 +0200)
commitbe22ebe79e64c3a8eb76f68743d97771f244cb18
tree505aca9cb451a9439c9b05e0f1870e0284ef0fe6
parentb97b305656a7013690e7b6e310f0e827e0bbff90
pinctrl: samsung: drop pin banks references on error paths

commit 50ebd19e3585b9792e994cfa8cbee8947fe06371 upstream.

The driver iterates over its devicetree children with
for_each_child_of_node() and stores for later found node pointer.  This
has to be put in error paths to avoid leak during re-probing.

Fixes: ab663789d697 ("pinctrl: samsung: Match pin banks with their device nodes")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Chanho Park <chanho61.park@samsung.com>
Link: https://lore.kernel.org/r/20220111201426.326777-2-krzysztof.kozlowski@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pinctrl/samsung/pinctrl-samsung.c