Skip to content

Commit

Permalink
regulator: core: Fix regualtor_ena_gpio_free not to access pin after …
Browse files Browse the repository at this point in the history
…freeing

commit 60a2362 upstream.

After freeing pin from regulator_ena_gpio_free, loop can access
the pin. So this patch fixes not to access pin after freeing.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
  • Loading branch information
Seung-Woo Kim authored and Ben Hutchings committed Jul 2, 2017
1 parent 7d8fa49 commit 702f4dd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
@@ -1709,6 +1709,8 @@ static void regulator_ena_gpio_free(struct regulator_dev *rdev)
gpio_free(pin->gpio);
list_del(&pin->list);
kfree(pin);
rdev->ena_pin = NULL;
return;
} else {
pin->request_count--;
}

0 comments on commit 702f4dd

Please sign in to comment.