]> Git Repo - linux.git/commitdiff
regulator/core: Revert "fix kobject release warning and memory leak in regulator_regi...
authorMichał Mirosław <[email protected]>
Mon, 18 Sep 2023 22:50:27 +0000 (00:50 +0200)
committerMark Brown <[email protected]>
Tue, 26 Sep 2023 15:26:08 +0000 (17:26 +0200)
This reverts commit 5f4b204b6b8153923d5be8002c5f7082985d153f.

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

Signed-off-by: Michał Mirosław <[email protected]>
Link: https://lore.kernel.org/r/d7f469f3f7b1f0e1d52f9a7ede3f3c5703382090.1695077303.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Mark Brown <[email protected]>
drivers/regulator/core.c

index 2820badc7a126433266632b31c4c5d4525dd6a22..3137e40fcd3e0586a81b1626304ab955a87695d4 100644 (file)
@@ -5724,15 +5724,11 @@ wash:
        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);
This page took 0.053912 seconds and 4 git commands to generate.