Skip to content

Commit

Permalink
pinctrl: madera: Fix possible NULL pointer with pdata config
Browse files Browse the repository at this point in the history
If we are being configured via pdata we don't necessarily have
any gpio mappings being configured that way so pdata->gpio_config
could be NULL.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
rfvirgil authored and linusw committed Aug 29, 2018
1 parent 823dd71 commit 5bc5a67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pinctrl/cirrus/pinctrl-madera-core.c
Expand Up @@ -1040,7 +1040,7 @@ static int madera_pin_probe(struct platform_device *pdev)
}

/* if the configuration is provided through pdata, apply it */
if (pdata) {
if (pdata && pdata->gpio_configs) {
ret = pinctrl_register_mappings(pdata->gpio_configs,
pdata->n_gpio_configs);
if (ret) {
Expand Down

0 comments on commit 5bc5a67

Please sign in to comment.