From: Mark Brown Date: Fri, 15 Jun 2012 17:25:08 +0000 (+0100) Subject: regulator: Fix double free in devm_regulator_put() X-Git-Tag: firefly_0821_release~3680^2~2413^2~12 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=230a5a1c41464f7fe5b676c21280ae4effa222c8;p=firefly-linux-kernel-4.4.55.git regulator: Fix double free in devm_regulator_put() Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 663ebd534ef9..729b20d1c1de 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1461,9 +1461,7 @@ void devm_regulator_put(struct regulator *regulator) rc = devres_release(regulator->dev, devm_regulator_release, devm_regulator_match, regulator); - if (rc == 0) - regulator_put(regulator); - else + if (rc != 0) WARN_ON(rc); } EXPORT_SYMBOL_GPL(devm_regulator_put);