[lvc-project] [PATCH v2] drm: bridge: cdns-mhdp8546: drop redundant NULL check

Жамбакиев Радий Рикардинович r.zhambakiev at prosoftsystems.ru
Wed Aug 26 15:05:11 MSK 2026


From: Radiy Zhambakiev <r.zhambakiev at prosoftsystems.ru>

to_cdns_mhdp_bridge_state() is a container_of() on the first member
of struct cdns_mhdp_bridge_state, so it cannot return NULL as long
as its input is non-NULL. The bridge state is already NULL-checked
right before the conversion, making the check on the converted
pointer dead code.

Remove it.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Radiy Zhambakiev <r.zhambakiev at prosoftsystems.ru>
---
Changes since v1:
- Fixed text encoding of the patch itself, so git am applies
correctly
- Added explicit `From: ...` to the top of the patch body, to
prevent checkpatch.pl email name mismatch error
 

 drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
index 36c07b71fe04..424183db6f76 100644
--- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
+++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
@@ -2145,11 +2145,6 @@ static int cdns_mhdp_update_link_status(struct cdns_mhdp_device *mhdp)
 		}
 
 		cdns_bridge_state = to_cdns_mhdp_bridge_state(state);
-		if (!cdns_bridge_state) {
-			ret = -EINVAL;
-			goto out;
-		}
-
 		current_mode = cdns_bridge_state->current_mode;
 		if (!current_mode) {
 			ret = -EINVAL;
-- 
2.53.0



More information about the lvc-project mailing list