]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: cros-ec-regulator: Fix double free of desc->name.
authorPi-Hsun Shih <pihsun@chromium.org>
Tue, 28 Jul 2020 09:19:09 +0000 (17:19 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 28 Jul 2020 15:53:14 +0000 (16:53 +0100)
commit0ef6932b62155ba662e02c20473032bc067b3f78
tree37fc366220602a9ee0bc23d8fcc9c577682c81f7
parent9dd8bc1cf90e8af1771c56e4b36aaae35296d0c7
regulator: cros-ec-regulator: Fix double free of desc->name.

The desc->name field is allocated with devm_kstrdup, but is also kfreed
on the error path, causing it to be double freed. Remove the kfree on
the error path.

Fixes: 0b3d0da5cbee ("regulator: Add driver for cros-ec-regulator")
Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20200728091909.2009771-1-pihsun@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/cros-ec-regulator.c