Blob Blame History Raw
From 203ea8c464238bc4ee6a9497b87ad2eda6786047 Mon Sep 17 00:00:00 2001
From: Alvin Lee <Alvin.Lee2@amd.com>
Date: Fri, 3 Dec 2021 16:29:05 -0500
Subject: drm/amd/display: Fix check for null function ptr
Git-commit: e56e9ad0370a29a4bee3a99fd517d8583804fd74
Patch-mainline: v5.17-rc1
References: jsc#PED-1166 jsc#PED-1168 jsc#PED-1170 jsc#PED-1218 jsc#PED-1220 jsc#PED-1222 jsc#PED-1223 jsc#PED-1225

[Why]
Bug fix for null function ptr (should check for NULL instead of not
NULL)

[How]
Fix if condition

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Samson Tam <samson.tam@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Patrik Jakobsson <pjakobsson@suse.de>
---
 drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
index f673a1c1777a..9280f2abd973 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
@@ -852,7 +852,7 @@ bool dmub_srv_should_detect(struct dmub_srv *dmub)
 
 enum dmub_status dmub_srv_clear_inbox0_ack(struct dmub_srv *dmub)
 {
-	if (!dmub->hw_init || dmub->hw_funcs.clear_inbox0_ack_register)
+	if (!dmub->hw_init || !dmub->hw_funcs.clear_inbox0_ack_register)
 		return DMUB_STATUS_INVALID;
 
 	dmub->hw_funcs.clear_inbox0_ack_register(dmub);
@@ -878,7 +878,7 @@ enum dmub_status dmub_srv_wait_for_inbox0_ack(struct dmub_srv *dmub, uint32_t ti
 enum dmub_status dmub_srv_send_inbox0_cmd(struct dmub_srv *dmub,
 		union dmub_inbox0_data_register data)
 {
-	if (!dmub->hw_init || dmub->hw_funcs.send_inbox0_cmd)
+	if (!dmub->hw_init || !dmub->hw_funcs.send_inbox0_cmd)
 		return DMUB_STATUS_INVALID;
 
 	dmub->hw_funcs.send_inbox0_cmd(dmub, data);
-- 
2.38.1