pinctrl: stm32: Fix bad function call

commit b7c747d462 upstream.

In stm32_pconf_parse_conf function, stm32_pmx_gpio_set_direction is
called with wrong parameter value. Indeed, using NULL value for range
will raise an oops.

Fixes: aceb16dc2d ("pinctrl: Add STM32 MCUs support")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Alexandre TORGUE 2017-05-30 16:43:04 +02:00 committed by Greg Kroah-Hartman
parent a3f2e309f6
commit 8240981690

View file

@ -798,7 +798,7 @@ static int stm32_pconf_parse_conf(struct pinctrl_dev *pctldev,
break; break;
case PIN_CONFIG_OUTPUT: case PIN_CONFIG_OUTPUT:
__stm32_gpio_set(bank, offset, arg); __stm32_gpio_set(bank, offset, arg);
ret = stm32_pmx_gpio_set_direction(pctldev, NULL, pin, false); ret = stm32_pmx_gpio_set_direction(pctldev, range, pin, false);
break; break;
default: default:
ret = -EINVAL; ret = -EINVAL;