mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 20:51:44 +00:00
pinctrl: qcom: Don't iterate past end of function array
Timur reports that this code crashes if nfunctions is 0. Fix the
loop iteration to only consider valid elements of the functions
array.
Reported-by: Timur Tabi <timur@codeaurora.org>
Cc: Pramod Gurav <pramod.gurav@smartplayin.com>
Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Cc: Ivan T. Ivanov <iivanov@mm-sol.com>
Cc: Andy Gross <agross@codeaurora.org>
Fixes: 327455817a
"pinctrl: qcom: Add support for reset for apq8064"
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
41f632fe17
commit
bcd53f858d
@ -865,10 +865,10 @@ static int msm_ps_hold_restart(struct notifier_block *nb, unsigned long action,
|
||||
|
||||
static void msm_pinctrl_setup_pm_reset(struct msm_pinctrl *pctrl)
|
||||
{
|
||||
int i = 0;
|
||||
int i;
|
||||
const struct msm_function *func = pctrl->soc->functions;
|
||||
|
||||
for (; i <= pctrl->soc->nfunctions; i++)
|
||||
for (i = 0; i < pctrl->soc->nfunctions; i++)
|
||||
if (!strcmp(func[i].name, "ps_hold")) {
|
||||
pctrl->restart_nb.notifier_call = msm_ps_hold_restart;
|
||||
pctrl->restart_nb.priority = 128;
|
||||
|
Loading…
Reference in New Issue
Block a user