1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-15 04:42:02 +00:00
openmptcprouter/root/target/linux/bcm27xx/patches-5.15/0624-drm-Fix-double-free-from-checking-if-gamma-lut-has-b.patch
2021-11-24 18:32:01 +01:00

31 lines
1.2 KiB
Diff

From 879dbb3bcb1c25a6938806c99dc8bd49fd8462af 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 624/634] 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(-)
diff --git a/drivers/gpu/drm/drm_color_mgmt.c b/drivers/gpu/drm/drm_color_mgmt.c
index f99b77d15dac..da282e7454a8 100644
--- 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(struct drm_crtc *crtc,
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);
--
2.33.1