dcss_dev_suspend() ignores the return value of drm_mode_config_helper_suspend(). On failure that helper rolls back its partial work (re-enables fbdev and polling) and leaves mode_config.suspend_state unset, i.e. the DRM side is not suspended. Continuing to suspend the context loader and disable the clocks then leaves the device in an inconsistent state. Check the return value and propagate the error to the PM core, as the other DRM drivers calling this helper do. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ") Cc: stable@vger.kernel.org Signed-off-by: Denis Arefev --- drivers/gpu/drm/imx/dcss/dcss-dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.c b/drivers/gpu/drm/imx/dcss/dcss-dev.c index 45a91e43bab1..0b12ce2498f0 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-dev.c +++ b/drivers/gpu/drm/imx/dcss/dcss-dev.c @@ -253,7 +253,9 @@ static int dcss_dev_suspend(struct device *dev) struct drm_device *ddev = dcss_drv_dev_to_drm(dev); int ret; - drm_mode_config_helper_suspend(ddev); + ret = drm_mode_config_helper_suspend(ddev); + if (ret) + return ret; if (pm_runtime_suspended(dev)) return 0; -- 2.43.0