[PATCH 08/12] drm/amd/display: Add null pointer filter

Agustin Gutierrez agustin.gutierrez at amd.com
Thu Mar 10 22:20:41 UTC 2022


From: Jing Zhou <Jing.Zhou at amd.com>

[Why & How]
Add null pointer filter for logical integrity.

Reviewed-by: Charlene Liu <Charlene.Liu at amd.com>
Acked-by: Agustin Gutierrez <agustin.gutierrez at amd.com>
Signed-off-by: Jing Zhou <Jing.Zhou at amd.com>
---
 drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c b/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c
index dae8e489c8cf..778c206f754d 100644
--- a/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c
+++ b/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c
@@ -647,7 +647,9 @@ enum gpio_result dal_ddc_set_config(
 void dal_ddc_close(
 	struct ddc *ddc)
 {
-	dal_gpio_close(ddc->pin_clock);
-	dal_gpio_close(ddc->pin_data);
+	if (ddc != NULL) {
+		dal_gpio_close(ddc->pin_clock);
+		dal_gpio_close(ddc->pin_data);
+	}
 }
 
-- 
2.35.1



More information about the amd-gfx mailing list