Skip to content

Commit

Permalink
drm/simpledrm: Fix power domain device link validity check
Browse files Browse the repository at this point in the history
We need to check if a link is non-NULL before trying to delete it.

Fixes: 61df9ca ("drm/simpledrm: Add support for multiple "power-domains"")
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Thomas Zimmermann <[email protected]>
Cc: Janne Grunau <[email protected]>
Cc: Eric Curtin <[email protected]>
Cc: Neal Gompa <[email protected]>
Cc: Sven Peter <[email protected]>
Cc: Javier Martinez Canillas <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
thierryreding authored and Thomas Zimmermann committed Oct 12, 2023
1 parent b9f2920 commit c395c83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/tiny/simpledrm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c395c83

Please sign in to comment.