mirror of
				https://github.com/Ysurac/openmptcprouter.git
				synced 2025-03-09 15:40:20 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
From 58dbcf5b82b3cc5202b1319d140ea79c32f7cc5e Mon Sep 17 00:00:00 2001
 | 
						|
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
 | 
						|
Date: Mon, 8 Nov 2021 13:55:15 +0000
 | 
						|
Subject: [PATCH 582/828] drm: Fix double free from checking if gamma lut has
 | 
						|
 been updated
 | 
						|
 | 
						|
The code falls through to "fail" under all conditions, so there is no
 | 
						|
need for the drm_property_blob_put if the gamma lut hasn't been changed.
 | 
						|
Fixes: 9cca26674a2b "drm: Check whether the gamma lut has changed before updating"
 | 
						|
 | 
						|
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
 | 
						|
---
 | 
						|
 drivers/gpu/drm/drm_color_mgmt.c | 2 --
 | 
						|
 1 file changed, 2 deletions(-)
 | 
						|
 | 
						|
--- a/drivers/gpu/drm/drm_color_mgmt.c
 | 
						|
+++ b/drivers/gpu/drm/drm_color_mgmt.c
 | 
						|
@@ -330,8 +330,6 @@ static int drm_crtc_legacy_gamma_set(str
 | 
						|
 	    memcmp(crtc_state->gamma_lut->data, blob_data, blob->length))
 | 
						|
 		replaced |= drm_property_replace_blob(&crtc_state->gamma_lut,
 | 
						|
 					      use_gamma_lut ? blob : NULL);
 | 
						|
-	else
 | 
						|
-		drm_property_blob_put(blob);
 | 
						|
 	crtc_state->color_mgmt_changed |= replaced;
 | 
						|
 
 | 
						|
 	ret = drm_atomic_commit(state);
 |