Skip to content

Commit 459915f

Browse files
javiercarrascocruzkrzk
authored andcommitted
pinctrl: samsung: fix fwnode refcount cleanup if platform_get_irq_optional() fails
Commit 50ebd19 ("pinctrl: samsung: drop pin banks references on error paths") fixed the pin bank references on the error paths of the probe function, but there is still an error path where this is not done. If samsung_pinctrl_get_soc_data() does not fail, the child references will have acquired, and they will need to be released in the error path of platform_get_irq_optional(), as it is done in the following error paths within the probe function. Replace the direct return in the error path with a goto instruction to the cleanup function. Cc: [email protected] Fixes: a382d56 ("pinctrl: samsung: Use platform_get_irq_optional() to get the interrupt") Signed-off-by: Javier Carrasco <[email protected]> Link: https://lore.kernel.org/r/[email protected] [krzysztof: change Fixes SHA to point to commit introducing the return leading to OF node leak] Signed-off-by: Krzysztof Kozlowski <[email protected]>
1 parent f686a2b commit 459915f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pinctrl/samsung/pinctrl-samsung.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
12721272

12731273
ret = platform_get_irq_optional(pdev, 0);
12741274
if (ret < 0 && ret != -ENXIO)
1275-
return ret;
1275+
goto err_put_banks;
12761276
if (ret > 0)
12771277
drvdata->irq = ret;
12781278

0 commit comments

Comments
 (0)