[PATCH RFC 103/111] staging: etnaviv: make sure to unlock DRM mutex when component bind fails

Lucas Stach l.stach at pengutronix.de
Thu Apr 2 08:30:45 PDT 2015


In case the component bind fails the mutex should not be left locked.

Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
---
 drivers/staging/etnaviv/etnaviv_drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/etnaviv/etnaviv_drv.c b/drivers/staging/etnaviv/etnaviv_drv.c
index 828ed8ce347f..799793ea0b38 100644
--- a/drivers/staging/etnaviv/etnaviv_drv.c
+++ b/drivers/staging/etnaviv/etnaviv_drv.c
@@ -141,8 +141,10 @@ static int etnaviv_load(struct drm_device *dev, unsigned long flags)
 	mutex_lock(&dev->struct_mutex);
 
 	err = component_bind_all(dev->dev, dev);
-	if (err < 0)
+	if (err < 0) {
+		mutex_unlock(&dev->struct_mutex);
 		return err;
+	}
 
 	load_gpu(dev);
 
-- 
2.1.4



More information about the dri-devel mailing list