Browse Source

disp: msm: update cleanup during bind failure in msm_drm_component_init

During msm_drm_bind if one of the sub components fails
to bind and defers the probe, it used to clear the device
platform device private structures which are created as
part of msm_pdev_probe. When sub devices try to bind as
part of probe sequence it will try to bringup master
msm_drm and accesses invalid address leading to crash.
This change updates the cleanup procedure which avoids
such crash.

Change-Id: I2d5c94cfafa3c5ec23b81bb0a080ad6e0e5b02ad
Signed-off-by: Mahadevan <[email protected]>
Mahadevan 3 years ago
parent
commit
64ae0c58f0
1 changed files with 5 additions and 1 deletions
  1. 5 1
      msm/msm_drv.c

+ 5 - 1
msm/msm_drv.c

@@ -829,8 +829,12 @@ static int msm_drm_component_init(struct device *dev)
 
 
 	/* Bind all our sub-components: */
 	/* Bind all our sub-components: */
 	ret = msm_component_bind_all(dev, ddev);
 	ret = msm_component_bind_all(dev, ddev);
-	if (ret)
+	if (ret == -EPROBE_DEFER) {
+		destroy_workqueue(priv->wq);
+		return ret;
+	} else if (ret) {
 		goto bind_fail;
 		goto bind_fail;
+	}
 
 
 	ret = msm_init_vram(ddev);
 	ret = msm_init_vram(ddev);
 	if (ret)
 	if (ret)