Skip to content

Commit fb27937

Browse files
6by9popcornmix
authored andcommitted
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: 9cca266 "drm: Check whether the gamma lut has changed before updating" Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent 20c6032 commit fb27937

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎drivers/gpu/drm/drm_color_mgmt.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,7 @@ static int drm_crtc_legacy_gamma_set(struct drm_crtc *crtc,
316316
if (!crtc_state->gamma_lut || !crtc_state->gamma_lut->data ||
317317
memcmp(crtc_state->gamma_lut->data, blob_data, blob->length))
318318
replaced |= drm_property_replace_blob(&crtc_state->gamma_lut, blob);
319-
else
320-
drm_property_blob_put(blob);
319+
321320
crtc_state->color_mgmt_changed |= replaced;
322321

323322
ret = drm_atomic_commit(state);

0 commit comments

Comments
 (0)