summaryrefslogtreecommitdiff
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorRichard Fitzgerald <rf@opensource.cirrus.com>2018-08-28 09:45:37 +0100
committerLinus Walleij <linus.walleij@linaro.org>2018-08-29 14:02:47 +0200
commit5bc5a671b1f4b3aa019264ce970d3683a9ffa761 (patch)
tree651b35f08f70caa9c785f541a52e4cb794e3f0d6 /drivers/pinctrl
parent823dd71f58eb2133c24af85fad056a8dbb1a76e9 (diff)
pinctrl: madera: Fix possible NULL pointer with pdata config
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>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/cirrus/pinctrl-madera-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/cirrus/pinctrl-madera-core.c b/drivers/pinctrl/cirrus/pinctrl-madera-core.c
index ece41fb2848f..c4f4d904e4a6 100644
--- a/drivers/pinctrl/cirrus/pinctrl-madera-core.c
+++ b/drivers/pinctrl/cirrus/pinctrl-madera-core.c
@@ -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) {