drm/atomic: avoid null pointer dereference on pointer crtc
Subsystems (3)
PATCH 1/1 drm/atomic: avoid null pointer dereference on pointer crtc
From: Colin Ian King <[email protected]>
Since moving to the new debug helper functions we now have a debug message that dereferences crtc to print a kernel debug message when crtc is null and so this debug message will now cause a null pointer dereference. Since this is a debug message it probably is just simplest to fix this by just removing the debug message altogether.
Addresses-Coverity: ("Dereference after null check")
--- drivers/gpu/drm/drm_atomic_uapi.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/gpu/drm/drm_atomic_uapi.c +0 -5
@@ -338,11 +338,6 @@ drm_atomic_set_crtc_for_connector(struct drm_connector_state *conn_state,"Link [CONNECTOR:%d:%s] state %p to [CRTC:%d:%s]\n" , connector->base.id, connector->name, conn_state, crtc->base.id, crtc->name); - }else { -drm_dbg_atomic (crtc->dev, -"Link [CONNECTOR:%d:%s] state %p to [NOCRTC]\n" , - connector->base.id, connector->name, - conn_state); }return 0 ;
Signature · 1 line
2.28.0
Quoted 7 lines · Colin King
From: Colin Ian King [email protected]
Since moving to the new debug helper functions we now have a debug message that dereferences crtc to print a kernel debug message when crtc is null and so this debug message will now cause a null pointer dereference. Since this is a debug message it probably is just simplest to fix this by just removing the debug message altogether.
NACK. This removes the log altogether instead of fixing it.
A fix has already been pushed to drm-misc-next: 0003b687ee6d ("drm: fix oops in drm_atomic_set_crtc_for_connector").
Quoted 10 lines · Simon Ser
Quoted 7 lines · Colin King
From: Colin Ian King [email protected]
Since moving to the new debug helper functions we now have a debug message that dereferences crtc to print a kernel debug message when crtc is null and so this debug message will now cause a null pointer dereference. Since this is a debug message it probably is just simplest to fix this by just removing the debug message altogether.
Quoted 5 lines
NACK. This removes the log altogether instead of fixing it.
A fix has already been pushed to drm-misc-next:
0003b687ee6d("drm: fix oops indrm_atomic_set_crtc_for_connector").
Good to see this has already been fixed. Thanks.
Colin