]> git.baikalelectronics.ru Git - kernel.git/commit
pinctrl: add checks for empty function names
authorTony Lindgren <tony@atomide.com>
Wed, 25 Jan 2012 00:28:08 +0000 (16:28 -0800)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 26 Jan 2012 13:13:11 +0000 (14:13 +0100)
commitb18c97b6147ab2d67f61d33451ee3a6c69a2eaf6
treeb7933b4d3e562e806c3dc61544352e46f35820cb
parentd50f47cf4cc150e9ecd8bf5acc56f7dc7b8486fb
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>
drivers/pinctrl/core.c
drivers/pinctrl/pinconf.c
drivers/pinctrl/pinconf.h
drivers/pinctrl/pinmux.c
drivers/pinctrl/pinmux.h