diff options
author | Tony Lindgren <tony@atomide.com> | 2012-01-24 19:28:08 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-01-26 08:13:11 -0500 |
commit | b9130b776ee481acbc27a7e56d98df75680de369 (patch) | |
tree | b7933b4d3e562e806c3dc61544352e46f35820cb /drivers/pinctrl/pinconf.h | |
parent | 9e2551e10b5c7ba550849bd9ed519e498cc30e68 (diff) |
pinctrl: add checks for empty function names
This is needed as otherwise we can get the following when
dealing with buggy data in a pinmux driver for
pinmux_search_function:
Unable to handle kernel NULL pointer dereference at virtual
address 00000000
...
PC is at strcmp+0xc/0x34
LR is at pinmux_get+0x350/0x8f4
...
As we need pctldev initialized to call ops->list_functions,
let's initialize it before check_ops calls and pass the
pctldev to the check_ops functions. Do this for both pinmux
and pinconf check_ops functions.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinconf.h')
-rw-r--r-- | drivers/pinctrl/pinconf.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinconf.h b/drivers/pinctrl/pinconf.h index e7dc6165032a..006b77fa737e 100644 --- a/drivers/pinctrl/pinconf.h +++ b/drivers/pinctrl/pinconf.h | |||
@@ -13,7 +13,7 @@ | |||
13 | 13 | ||
14 | #ifdef CONFIG_PINCONF | 14 | #ifdef CONFIG_PINCONF |
15 | 15 | ||
16 | int pinconf_check_ops(const struct pinconf_ops *ops); | 16 | int pinconf_check_ops(struct pinctrl_dev *pctldev); |
17 | void pinconf_init_device_debugfs(struct dentry *devroot, | 17 | void pinconf_init_device_debugfs(struct dentry *devroot, |
18 | struct pinctrl_dev *pctldev); | 18 | struct pinctrl_dev *pctldev); |
19 | int pin_config_get_for_pin(struct pinctrl_dev *pctldev, unsigned pin, | 19 | int pin_config_get_for_pin(struct pinctrl_dev *pctldev, unsigned pin, |
@@ -23,7 +23,7 @@ int pin_config_set_for_pin(struct pinctrl_dev *pctldev, unsigned pin, | |||
23 | 23 | ||
24 | #else | 24 | #else |
25 | 25 | ||
26 | static inline int pinconf_check_ops(const struct pinconf_ops *ops) | 26 | static inline int pinconf_check_ops(struct pinctrl_dev *pctldev) |
27 | { | 27 | { |
28 | return 0; | 28 | return 0; |
29 | } | 29 | } |