MLK-16813 drm/imx: core: Set driver data to NULL when we bailout from ->bind()
authorLiu Ying <victor.liu@nxp.com>
Tue, 14 Nov 2017 05:18:46 +0000 (13:18 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:46:57 +0000 (15:46 -0500)
We need to set driver data to NULL when we bailout from ->bind(),
otherwise it would be leaked to the system power management operations
and cause invalid driver data being used there.

Reported-by: Anson Huang <Anson.Huang@nxp.com>
Fixes: 54db5decce17 ("drm/imx: drop deprecated load/unload drm_driver ops")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
drivers/gpu/drm/imx/imx-drm-core.c

index cb83083..916c9f5 100644 (file)
@@ -432,6 +432,7 @@ err_unbind:
 #endif
        component_unbind_all(drm->dev, drm);
 err_vblank:
+       dev_set_drvdata(dev, NULL);
        drm_vblank_cleanup(drm);
 err_kms:
        drm_mode_config_cleanup(drm);