Re: [PATCH] regulator: Fix double free in devm_regulator_put()

From: Joe Perches
Date: Fri Jun 15 2012 - 14:03:45 EST


On Fri, 2012-06-15 at 18:55 +0100, Mark Brown wrote:
> diff --git 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);

Seems an odd style choice. Perhaps:

rc = devres_release(regulator->dev, devm_regulator_release,
devm_regulator_match, regulator);
WARN_ON(rc);


--
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/