* [PATCH 1/2] mfd: max77686: fix regmap resource leak on driver remove
@ 2013-12-20 9:35 Krzysztof Kozlowski
2013-12-20 13:56 ` Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Kozlowski @ 2013-12-20 9:35 UTC (permalink / raw)
To: Samuel Ortiz, Lee Jones, linux-kernel
Cc: Krzysztof Kozlowski, Kyungmin Park, Marek Szyprowski, stable
The regmap used by max77686 MFD driver was not freed with regmap_exit()
on driver exit. This lead to leak of resources.
Replace regmap_init_i2c() call in driver probe with initialization of
managed register map so the regmap will be properly freed by the device
management code.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: stable@vger.kernel.org
---
drivers/mfd/max77686.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c
index 34520cbe8afb..12b3ae3aa7c5 100644
--- a/drivers/mfd/max77686.c
+++ b/drivers/mfd/max77686.c
@@ -104,7 +104,7 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
max77686->irq_gpio = pdata->irq_gpio;
max77686->irq = i2c->irq;
- max77686->regmap = regmap_init_i2c(i2c, &max77686_regmap_config);
+ max77686->regmap = devm_regmap_init_i2c(i2c, &max77686_regmap_config);
if (IS_ERR(max77686->regmap)) {
ret = PTR_ERR(max77686->regmap);
dev_err(max77686->dev, "Failed to allocate register map: %d\n",
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/2] mfd: max77686: fix regmap resource leak on driver remove
2013-12-20 9:35 [PATCH 1/2] mfd: max77686: fix regmap resource leak on driver remove Krzysztof Kozlowski
@ 2013-12-20 13:56 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2013-12-20 13:56 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Samuel Ortiz, linux-kernel, Kyungmin Park, Marek Szyprowski,
stable
On Fri, 20 Dec 2013, Krzysztof Kozlowski wrote:
> The regmap used by max77686 MFD driver was not freed with regmap_exit()
> on driver exit. This lead to leak of resources.
>
> Replace regmap_init_i2c() call in driver probe with initialization of
> managed register map so the regmap will be properly freed by the device
> management code.
>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Marek Szyprowski <m.szyprowski@samsung.com>
> Cc: stable@vger.kernel.org
> ---
> drivers/mfd/max77686.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Always happy to move to managed resources.
Applied, thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-20 13:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-20 9:35 [PATCH 1/2] mfd: max77686: fix regmap resource leak on driver remove Krzysztof Kozlowski
2013-12-20 13:56 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).