Skip to content

Commit

Permalink
gpiolib: acpi: Don't contaminate return parameter in case of error
Browse files Browse the repository at this point in the history
If error occurs, leave lookup parameter untouched.

There is no functional change, since all current callers just bail out
in case of error without using the assigned pieces.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Andy Shevchenko authored and Linus Walleij committed Nov 30, 2017
1 parent f67a6c1 commit 08be1a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpio/gpiolib-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,14 +585,14 @@ static int acpi_gpio_property_lookup(struct fwnode_handle *fwnode,
* The property was found and resolved, so need to lookup the GPIO based
* on returned args.
*/
lookup->adev = args.adev;
if (args.nargs != 3)
return -EPROTO;

lookup->index = args.args[0];
lookup->pin_index = args.args[1];
lookup->active_low = !!args.args[2];

lookup->adev = args.adev;
return 0;
}

Expand Down

0 comments on commit 08be1a7

Please sign in to comment.