[PATCH] drm/display/dp_mst: Fix missing check for return value of drm_atomic_get_mst_payload_state()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The drm_atomic_get_mst_payload_state() function may
return NULL, which may cause null pointer deference,
and most other callsites of drm_atomic_get_mst_payload_state()
do Null check. Add Null check for return value of
drm_atomic_get_mst_payload_state().

Found by our static analysis tool.

Signed-off-by: Chenyuan Mi <cymi20@xxxxxxxxxxxx>
---
 drivers/gpu/drm/display/drm_dp_mst_topology.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c
index 38dab76ae69e..27f4bcf409ea 100644
--- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
@@ -4434,6 +4434,8 @@ void drm_dp_mst_atomic_wait_for_dependencies(struct drm_atomic_state *state)
 
 			new_payload = drm_atomic_get_mst_payload_state(new_mst_state,
 								       old_payload->port);
+			if (!new_payload)
+				continue;
 			new_payload->vc_start_slot = old_payload->vc_start_slot;
 		}
 	}
-- 
2.17.1




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux