mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] regulator/core: A quick fix for struct device handling
@ 2023-09-17 21:35 Michał Mirosław
  2023-09-17 21:35 ` [PATCH 2/2] Revert "regulator: core: fix kobject release warning and memory leak in regulator_register()" Michał Mirosław
  2023-09-17 21:35 ` [PATCH 1/2] regulator/core: regulator_register: set device->class earlier Michał Mirosław
  0 siblings, 2 replies; 4+ messages in thread
From: Michał Mirosław @ 2023-09-17 21:35 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: linux-kernel, Vladimir Zapolskiy, Zeng Heng

When fixing a memory leak in commit d3c731564e09 ("regulator: plug of_node
leak in regulator_register()'s error path") it moved the device_initialize()
call earlier, but did not move the dev->class initialization.  The bug
was spotted and fixed by reverting part of the commit (in commit
5f4b204b6b81 "regulator: core: fix kobject release warning and memory
leak in regulator_register()") and introducing a different bug: now
early error paths use kfree(dev) instead of put_device() for an already
initialized struct device.

This series fixes the original bug and reverts the problematic fix.

Michał Mirosław (2):
  regulator/core: regulator_register: set device->class earlier
  Revert "regulator: core: fix kobject release warning and memory leak
    in regulator_register()"

 drivers/regulator/core.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

-- 
2.39.2


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

end of thread, other threads:[~2023-09-18 12:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-17 21:35 [PATCH 0/2] regulator/core: A quick fix for struct device handling Michał Mirosław
2023-09-17 21:35 ` [PATCH 2/2] Revert "regulator: core: fix kobject release warning and memory leak in regulator_register()" Michał Mirosław
2023-09-18 12:05   ` Mark Brown
2023-09-17 21:35 ` [PATCH 1/2] regulator/core: regulator_register: set device->class earlier Michał Mirosław

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

all inboxes | Powered by JetHome®