[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <cover.1694985959.git.mirq-linux@rere.qmqm.pl>
Date: Sun, 17 Sep 2023 23:35:13 +0200
From: Michał Mirosław <mirq-linux@...e.qmqm.pl>
To: Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>
Cc: linux-kernel@...r.kernel.org, Vladimir Zapolskiy <vz@...ia.com>,
Zeng Heng <zengheng4@...wei.com>
Subject: [PATCH 0/2] regulator/core: A quick fix for struct device handling
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
Powered by blists - more mailing lists