Re: [PATCH] pinctrl: fix error path in pinconf_map_to_setting()

From: Stephen Warren
Date: Mon Mar 12 2012 - 17:04:48 EST


On 03/12/2012 02:41 PM, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@xxxxxxxxxx>
>
> The code was using the union member
> setting->data.configs.group_or_pin to store a potential
> error code, but since that member is unsigned the
> < 0 comparison was not true, letting errors pass thru,

"thru" is a pet peeve of mine; it'd be great to spell this correctly as
"through".

> ending up as mapped to pin "-22". Fix this up and print
> the error.

Oops. Sorry about that.

> Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
...
> - setting->data.configs.group_or_pin =
> - pin_get_from_name(pctldev,
> - map->data.configs.group_or_pin);
> - if (setting->data.configs.group_or_pin < 0)
> - return setting->data.configs.group_or_pin;
> + ret = pin_get_from_name(pctldev,
> + map->data.configs.group_or_pin);
> + if (ret < 0) {

"ret" here is named "pin" other places pin_get_from_name() is called,
and that naming seems to make a bit more sense here too.

Otherwise,
Acked-by: Stephen Warren <swarren@xxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/