Skip to contentSkip to conversation

Revert "ALSA: pcmtest: fix reference leak on failed device registration"

PATCH New Takashi Iwai 1 participant 1 message Apr 23

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "ALSA: pcmtest: fix reference leak on failed device registration"

We'd like to address the problem rather in the error code path of platform_device_register() itself instead of leaving it all callers, since less than 1% of all callers of over 100 platform_device_register() do call platform_device_put() properly as of now.

For making the work easier, revert the previous change commit 4ff036f95238 ("ALSA: pcmtest: fix reference leak on failed device registration") again.

---
 sound/drivers/pcmtest.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
sound/drivers/pcmtest.c +1 -3
index fe31ff1e5b3c..5bfec4c7bf71 100644
@@ -756,10 +756,8 @@ static int __init mod_init(void)
 	if (err)
 		goto err_free_patterns;
 	err = platform_device_register(&pcmtst_pdev);
-	if (err) {
-		platform_device_put(&pcmtst_pdev);
+	if (err)
 		goto err_clear_debug;
-	}
 	err = platform_driver_register(&pcmtst_pdrv);
 	if (err) {
 		platform_device_unregister(&pcmtst_pdev);
Signature · 1 line
2.53.0