From: Jing Zhou <jing.z...@amd.com>

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

Reviewed-by: Charlene Liu <charlene....@amd.com>
Acked-by: Agustin Gutierrez <agustin.gutier...@amd.com>
Signed-off-by: Jing Zhou <jing.z...@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

Reply via email to