Unverified Commit 6e800968 authored by Michał Mirosław's avatar Michał Mirosław Committed by Mark Brown
Browse files

regulator/core: Revert "fix kobject release warning and memory leak in regulator_register()"



This reverts commit 5f4b204b.

Since rdev->dev now has a release() callback, the proper way of freeing
the initialized device can be restored.

Signed-off-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
Link: https://lore.kernel.org/r/d7f469f3f7b1f0e1d52f9a7ede3f3c5703382090.1695077303.git.mirq-linux@rere.qmqm.pl


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8adb4e64
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -5724,15 +5724,11 @@ regulator_register(struct device *dev,
	mutex_lock(&regulator_list_mutex);
	regulator_ena_gpio_free(rdev);
	mutex_unlock(&regulator_list_mutex);
	put_device(&rdev->dev);
	rdev = NULL;
clean:
	if (dangling_of_gpiod)
		gpiod_put(config->ena_gpiod);
	if (rdev && rdev->dev.of_node)
		of_node_put(rdev->dev.of_node);
	kfree(rdev);
	kfree(config);
	put_device(&rdev->dev);
rinse:
	if (dangling_cfg_gpiod)
		gpiod_put(cfg->ena_gpiod);