linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: update document for pinconf_generic_parse_dt_config
@ 2015-11-25 12:13 Yingjoe Chen
  2015-12-01 10:12 ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Yingjoe Chen @ 2015-11-25 12:13 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-gpio, linux-kernel, linux-arm-kernel, ludovic.desroches,
	Yingjoe Chen

The returned configs from pinconf_generic_parse_dt_config() is
duplicated from original. Make it clear it must be freed when no
longer necessary.

Signed-off-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
---
It seems memleak in pinctrl-mtk-common.c[1] is not alone. After a quick
glance I notice similar issues in drivers/pinctrl/pinctrl-at91-pio4.c and
drivers/pinctrl/nomadik/pinctrl-abx500.c.

I think it make sense to update document to make it clear it should be freed.

[1] http://lists.infradead.org/pipermail/linux-mediatek/2015-November/002967.html
---
 drivers/pinctrl/pinconf-generic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c
index 099a344..79e6159 100644
--- a/drivers/pinctrl/pinconf-generic.c
+++ b/drivers/pinctrl/pinconf-generic.c
@@ -220,6 +220,7 @@ static void parse_dt_cfg(struct device_node *np,
  * parse the config properties into generic pinconfig values.
  * @np: node containing the pinconfig properties
  * @configs: array with nconfigs entries containing the generic pinconf values
+ *           must be freed when no longer necessary.
  * @nconfigs: umber of configurations
  */
 int pinconf_generic_parse_dt_config(struct device_node *np,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: update document for pinconf_generic_parse_dt_config
  2015-11-25 12:13 [PATCH] pinctrl: update document for pinconf_generic_parse_dt_config Yingjoe Chen
@ 2015-12-01 10:12 ` Linus Walleij
  2015-12-01 10:26   ` Ludovic Desroches
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2015-12-01 10:12 UTC (permalink / raw)
  To: Yingjoe Chen
  Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, Ludovic Desroches

On Wed, Nov 25, 2015 at 1:13 PM, Yingjoe Chen <yingjoe.chen@mediatek.com> wrote:

> The returned configs from pinconf_generic_parse_dt_config() is
> duplicated from original. Make it clear it must be freed when no
> longer necessary.
>
> Signed-off-by: Yingjoe Chen <yingjoe.chen@mediatek.com>

Patch applied.

> It seems memleak in pinctrl-mtk-common.c[1] is not alone. After a quick
> glance I notice similar issues in drivers/pinctrl/pinctrl-at91-pio4.c and
> drivers/pinctrl/nomadik/pinctrl-abx500.c.

Patches fixing them are coming? ;)

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: update document for pinconf_generic_parse_dt_config
  2015-12-01 10:12 ` Linus Walleij
@ 2015-12-01 10:26   ` Ludovic Desroches
  0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Desroches @ 2015-12-01 10:26 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Yingjoe Chen, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, Ludovic Desroches

On Tue, Dec 01, 2015 at 11:12:16AM +0100, Linus Walleij wrote:
> On Wed, Nov 25, 2015 at 1:13 PM, Yingjoe Chen <yingjoe.chen@mediatek.com> wrote:
> 
> > The returned configs from pinconf_generic_parse_dt_config() is
> > duplicated from original. Make it clear it must be freed when no
> > longer necessary.
> >
> > Signed-off-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
> 
> Patch applied.
> 
> > It seems memleak in pinctrl-mtk-common.c[1] is not alone. After a quick
> > glance I notice similar issues in drivers/pinctrl/pinctrl-at91-pio4.c and
> > drivers/pinctrl/nomadik/pinctrl-abx500.c.
> 
> Patches fixing them are coming? ;)

Yes, it's planned.

Regards

Ludovic

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-01 10:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-25 12:13 [PATCH] pinctrl: update document for pinconf_generic_parse_dt_config Yingjoe Chen
2015-12-01 10:12 ` Linus Walleij
2015-12-01 10:26   ` Ludovic Desroches

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).