aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/tasks.py
diff options
context:
space:
mode:
authorStephen Boyd <[email protected]>2021-03-25 14:28:22 -0700
committerRob Clark <[email protected]>2021-04-01 14:19:15 -0700
commit5620b135aea49a8f41c86aaecfcb1598a7774121 (patch)
tree863351708df01544f50e23d186a4208c6f305dfd /scripts/gdb/linux/tasks.py
parent627dc55c273dab308303a5217bd3e767d7083ddb (diff)
drm/msm: Set drvdata to NULL when msm_drm_init() fails
We should set the platform device's driver data to NULL here so that code doesn't assume the struct drm_device pointer is valid when it could have been destroyed. The lifetime of this pointer is managed by a kref but when msm_drm_init() fails we call drm_dev_put() on the pointer which will free the pointer's memory. This driver uses the component model, so there's sort of two "probes" in this file, one for the platform device i.e. msm_pdev_probe() and one for the component i.e. msm_drm_bind(). The msm_drm_bind() code is using the platform device's driver data to store struct drm_device so the two functions are intertwined. This relationship becomes a problem for msm_pdev_shutdown() when it tests the NULL-ness of the pointer to see if it should call drm_atomic_helper_shutdown(). The NULL test is a proxy check for if the pointer has been freed by kref_put(). If the drm_device has been destroyed, then we shouldn't call the shutdown helper, and we know that is the case if msm_drm_init() failed, therefore set the driver data to NULL so that this pointer liveness is tracked properly. Fixes: 9d5cbf5fe46e ("drm/msm: add shutdown support for display platform_driver") Cc: Dmitry Baryshkov <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: Krishna Manikandan <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Message-Id: <[email protected]> Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/tasks.py')
0 files changed, 0 insertions, 0 deletions