]> git.baikalelectronics.ru Git - kernel.git/commit
pinctrl: fix signed vs unsigned conditionals inside pinmux_map_to_setting
authorJohn Crispin <blogic@openwrt.org>
Mon, 23 Apr 2012 17:01:58 +0000 (19:01 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 24 Apr 2012 13:09:50 +0000 (15:09 +0200)
commit9cf481683888829b2e7aca7fe6f0f15e9747823c
tree97d38f59d412ca6f001f0674652958f0790466a9
parent9d4a21d8c4e1fa12afdbf95ef978a7a715cd5ae3
pinctrl: fix signed vs unsigned conditionals inside pinmux_map_to_setting

pinmux_map_to_setting() uses setting->data.mux.func/group to store the return
code of pinmux_func_name_to_selector/pinctrl_get_group_selector(). However,
struct pinctrl_setting_mux defines these elements as unsigned, resulting in all
error codes getting lost. The conditionals following the assignments will always
evaluate to false thus breaking the error paths.

This bug can be triggered by loading a pinmux group map from the devicetree
with an invalid function/group string.

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinmux.c