mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	backend/drm: fix crash on VT switch
Don't set the MODE flag when disabling a CRTC. This fixes a NULL pointer dereference in drm_connector_state_init.
This commit is contained in:
		
							parent
							
								
									3c74bd0c91
								
							
						
					
					
						commit
						274c8189d4
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
					@ -110,11 +110,13 @@ static void handle_session_active(struct wl_listener *listener, void *data) {
 | 
				
			||||||
		struct wlr_drm_connector *conn;
 | 
							struct wlr_drm_connector *conn;
 | 
				
			||||||
		wl_list_for_each(conn, &drm->outputs, link) {
 | 
							wl_list_for_each(conn, &drm->outputs, link) {
 | 
				
			||||||
			struct wlr_output_mode *mode = NULL;
 | 
								struct wlr_output_mode *mode = NULL;
 | 
				
			||||||
 | 
								uint32_t committed = WLR_OUTPUT_STATE_ENABLED;
 | 
				
			||||||
			if (conn->output.enabled && conn->output.current_mode != NULL) {
 | 
								if (conn->output.enabled && conn->output.current_mode != NULL) {
 | 
				
			||||||
 | 
									committed |= WLR_OUTPUT_STATE_MODE;
 | 
				
			||||||
				mode = conn->output.current_mode;
 | 
									mode = conn->output.current_mode;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			struct wlr_output_state state = {
 | 
								struct wlr_output_state state = {
 | 
				
			||||||
				.committed = WLR_OUTPUT_STATE_MODE | WLR_OUTPUT_STATE_ENABLED,
 | 
									.committed = committed,
 | 
				
			||||||
				.enabled = mode != NULL,
 | 
									.enabled = mode != NULL,
 | 
				
			||||||
				.mode_type = WLR_OUTPUT_STATE_MODE_FIXED,
 | 
									.mode_type = WLR_OUTPUT_STATE_MODE_FIXED,
 | 
				
			||||||
				.mode = mode,
 | 
									.mode = mode,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue