drm/exynos: Avoid NULL pointer dereference in resume if bind failed
Subsystems (4)
PATCH 1/1 drm/exynos: Avoid NULL pointer dereference in resume if bind failed
If binding failed calling exynos_dp_enable in exynos_dp_resume will result in several NULL pointer dereferences. It is much better to simply skip suspend/resume handling if bind has failed, do so by checking if a drm_dev exists.
--- drivers/gpu/drm/exynos/exynos_dp_core.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/gpu/drm/exynos/exynos_dp_core.c +6 -0
@@ -1388,6 +1388,9 @@ static int exynos_dp_suspend(struct device *dev) {struct exynos_dp_device *dp =dev_get_drvdata (dev); +if (!dp->drm_dev) +return 0 ; +exynos_dp_disable (&dp->encoder);return 0 ; }
@@ -1396,6 +1399,9 @@ static int exynos_dp_resume(struct device *dev) {struct exynos_dp_device *dp =dev_get_drvdata (dev); +if (!dp->drm_dev) +return 0 ; +exynos_dp_enable (&dp->encoder);return 0 ; }
Signature · 1 line
1.7.2.5
Inki Dae
maintainerHi,
Quoted 4 lines · Charles Keepax
If binding failed calling
exynos_dp_enableinexynos_dp_resumewill result in several NULL pointer dereferences. It is much better to simply skip suspend/resume handling if bind has failed, do so by checking if adrm_devexists.
Thanks for your patch. However, the pm interfaces of KMS drivers aren't required because these are controlled by top of Exynos drm driver and connector dpms. So I posted a patch that it removes pm interfaces of dp driver.
Thanks,
Inki Dae
Quoted 31 lines
Signed-off-by Charles Keepax <[email protected]>--- drivers/gpu/drm/exynos/exynos_dp_core.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)drivers/gpu/drm/exynos/exynos_dp_core.c +6
-0@@ -1388,6 +1388,9 @@ static int exynos_dp_suspend(struct device *dev) {struct exynos_dp_device *dp =dev_get_drvdata (dev); +if (!dp->drm_dev) +return 0 ; +exynos_dp_disable (&dp->encoder);return 0 ; }@@ -1396,6 +1399,9 @@ static int exynos_dp_resume(struct device *dev) {struct exynos_dp_device *dp =dev_get_drvdata (dev); +if (!dp->drm_dev) +return 0 ; +exynos_dp_enable (&dp->encoder);return 0 ; }
Quoted 8 lines · Inki Dae
Hi,
Quoted 4 lines · Charles Keepax
If binding failed calling
exynos_dp_enableinexynos_dp_resumewill result in several NULL pointer dereferences. It is much better to simply skip suspend/resume handling if bind has failed, do so by checking if adrm_devexists.
Quoted 4 lines
Thanks for your patch. However, the pm interfaces of KMS drivers aren't required because these are controlled by top of Exynos drm driver and connector dpms. So I posted a patch that it removes pm interfaces of dp driver.
No problems at all, as long as my Arndale starts resuming without a NULL pointer I am happy :-)
Had a quick test of your patch it appears to fix my issue as well so totally fine with that.
Thanks,
Charles