aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo Lebrun <[email protected]>2024-03-06 17:19:45 +0100
committerLinus Walleij <[email protected]>2024-03-06 20:47:14 +0100
commita0c807b5b65a73b321a5313662625a85b18a7037 (patch)
tree646cc8ea0b3af7ebbc0189ab31053bd89d91aba6
parent5545d5013c0ec96f2a920bdfc681cdd72a570dd8 (diff)
pinctrl: nomadik: fix dereference of error pointer
If nmk_gpio_populate_chip() returns an error, avoid deferencing its return value. Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/linux-gpio/[email protected]/ Signed-off-by: Théo Lebrun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
-rw-r--r--drivers/pinctrl/nomadik/pinctrl-nomadik.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
index 47d5484f6bdf..cb0f0d5a5e45 100644
--- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c
+++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
@@ -1228,9 +1228,10 @@ static int nmk_pinctrl_probe(struct platform_device *pdev)
if (IS_ERR(nmk_chip))
dev_err(&pdev->dev,
"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);
- /* We are NOT compatible with mobileye,eyeq5-gpio. */
- BUG_ON(nmk_chip->is_mobileye_soc);
}
prcm_fwnode = fwnode_find_reference(fwnode, "prcm", 0);