[PATCH -next] drm/panel: missing platform_driver_unregister() on error in panel_simple_init()

Wei Yongjun weiyj.lk at gmail.com
Thu Dec 19 17:48:07 PST 2013


From: Wei Yongjun <yongjun_wei at trendmicro.com.cn>

Add the missing platform_driver_unregister() before return
from panel_simple_init() in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei at trendmicro.com.cn>
---
 drivers/gpu/drm/panel/panel-simple.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 3e611af..d801162 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -476,10 +476,14 @@ static int __init panel_simple_init(void)
 	if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
 		err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
 		if (err < 0)
-			return err;
+			goto err_dsi_driver_register;
 	}
 
 	return 0;
+
+err_dsi_driver_register:
+	platform_driver_unregister(&panel_simple_platform_driver);
+	return err;
 }
 module_init(panel_simple_init);
 



More information about the dri-devel mailing list