Commit a0c807b5 authored by Théo Lebrun's avatar Théo Lebrun Committed by Linus Walleij

pinctrl: nomadik: fix dereference of error pointer

If nmk_gpio_populate_chip() returns an error, avoid deferencing its
return value.
Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-gpio/5ee722f8-7582-420d-8477-45be6acde90f@moroto.mountain/Signed-off-by: default avatarThéo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240306-mbly-gpio-err-fix-v1-1-a3605ba2336f@bootlin.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 5545d501
...@@ -1228,9 +1228,10 @@ static int nmk_pinctrl_probe(struct platform_device *pdev) ...@@ -1228,9 +1228,10 @@ static int nmk_pinctrl_probe(struct platform_device *pdev)
if (IS_ERR(nmk_chip)) if (IS_ERR(nmk_chip))
dev_err(&pdev->dev, dev_err(&pdev->dev,
"could not populate nmk chip struct - continue anyway\n"); "could not populate nmk chip struct - continue anyway\n");
else
/* We are NOT compatible with mobileye,eyeq5-gpio. */
BUG_ON(nmk_chip->is_mobileye_soc);
fwnode_handle_put(gpio_fwnode); fwnode_handle_put(gpio_fwnode);
/* We are NOT compatible with mobileye,eyeq5-gpio. */
BUG_ON(nmk_chip->is_mobileye_soc);
} }
prcm_fwnode = fwnode_find_reference(fwnode, "prcm", 0); prcm_fwnode = fwnode_find_reference(fwnode, "prcm", 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment