From: Thierry Reding <treding@xxxxxxxxxx> We need to check if a link is non-NULL before trying to delete it. Signed-off-by: Thierry Reding <treding@xxxxxxxxxx> --- drivers/gpu/drm/tiny/simpledrm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c index 9c597461d1e2..8bdaf66044fc 100644 --- a/drivers/gpu/drm/tiny/simpledrm.c +++ b/drivers/gpu/drm/tiny/simpledrm.c @@ -506,7 +506,7 @@ static void simpledrm_device_detach_genpd(void *res) return; for (i = sdev->pwr_dom_count - 1; i >= 0; i--) { - if (!sdev->pwr_dom_links[i]) + if (sdev->pwr_dom_links[i]) device_link_del(sdev->pwr_dom_links[i]); if (!IS_ERR_OR_NULL(sdev->pwr_dom_devs[i])) dev_pm_domain_detach(sdev->pwr_dom_devs[i], true); -- 2.42.0