[PATCH V2] pinctrl: fix signed vs unsigned conditionals inside pinmux_map_to_setting

Dong Aisheng aisheng.dong at freescale.com
Tue Apr 24 15:34:17 EST 2012


On Mon, Apr 23, 2012 at 07:01:58PM +0200, John Crispin wrote:
> 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 at openwrt.org>
> Cc: Stephen Warren <swarren at nvidia.com>
> Cc: Dong Aisheng <dong.aisheng at linaro.org>
> ---
>  drivers/pinctrl/pinmux.c |   15 ++++++++-------
>  1 files changed, 8 insertions(+), 7 deletions(-)
> 
Nice fix.

Acked-by: Dong Aisheng <dong.aisheng at linaro.org>

Regards
Dong Aisheng



More information about the devicetree-discuss mailing list