pinctrl: qcom: Don't iterate past end of function array
authorStephen Boyd <sboyd@codeaurora.org>
Mon, 19 Jan 2015 10:17:45 +0000 (11:17 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 19 Jan 2015 10:17:45 +0000 (11:17 +0100)
commitbcd53f858d87f52843cc87764b283999126a50d6
tree02e579388bad3906b1cd835afe5e4097be2a12a0
parent41f632fe177bc4822c2e8236fe7c291e6e9eb6f8
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: 327455817a92 "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>
drivers/pinctrl/qcom/pinctrl-msm.c