mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] regulator: gpio: fix error paths in probe()
@ 2016-01-28 19:55 Harald Geyer
  2016-01-28 19:55 ` [PATCH 1/2] regulator: gpio: Avoid unnecessarily copying data structures " Harald Geyer
  2016-01-28 19:55 ` [PATCH 2/2] regulator: gpio: Move last remaining memory allocation to devres Harald Geyer
  0 siblings, 2 replies; 6+ messages in thread
From: Harald Geyer @ 2016-01-28 19:55 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Heiko Stuebner; +Cc: linux-kernel, Harald Geyer

Currently resources aren't freed in the order in which they have been
allocated. Eg probe() frees drvdata->states even if it failed before
allocating that. I think allocating/copying the affacted data structures
isn't necessary anyway, so this is the easiest way to fix this.

Patch 1/2 is the actual fix.
Patch 2/2 is minor cleanup while looking at the code.

This series has only been compile tested yet. I will test it on
device-tree HW when I get access to my test equipment. I can't test
non-device-tree code however.

Other notes:
* This driver passes &drvdata->desc uninitialized (but zeroed) to
  of_get_gpio_regulator_config() - I don't know if this is ok.
* I'm not sure if copying config->supply_name is actually necessary,
  so I left that one in.

Harald Geyer (2):
  regulator: gpio: Avoid unnecessarily copying data structures in
    probe()
  regulator: gpio: Move last remaining memory allocation to devres

 drivers/regulator/gpio-regulator.c | 46 +++++++++-----------------------------
 1 file changed, 10 insertions(+), 36 deletions(-)

-- 
2.1.4

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

end of thread, other threads:[~2016-02-03 17:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-28 19:55 [PATCH 0/2] regulator: gpio: fix error paths in probe() Harald Geyer
2016-01-28 19:55 ` [PATCH 1/2] regulator: gpio: Avoid unnecessarily copying data structures " Harald Geyer
2016-01-28 23:09   ` Mark Brown
2016-01-29 16:25     ` Harald Geyer
2016-02-03 17:20       ` Mark Brown
2016-01-28 19:55 ` [PATCH 2/2] regulator: gpio: Move last remaining memory allocation to devres Harald Geyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome