c0aee3797dc323b0ef8965d8f0f18d8fc082ed0c
[openwrt/staging/neocturne.git] /
1 From 3e52ea57180471250ba4bb426527ab9bbad4e5a4 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Mon, 8 Nov 2021 13:55:15 +0000
4 Subject: [PATCH] drm: Fix double free from checking if gamma lut has
5 been updated
6
7 The code falls through to "fail" under all conditions, so there is no
8 need for the drm_property_blob_put if the gamma lut hasn't been changed.
9 Fixes: 9cca26674a2b "drm: Check whether the gamma lut has changed before updating"
10
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
12 ---
13 drivers/gpu/drm/drm_color_mgmt.c | 2 --
14 1 file changed, 2 deletions(-)
15
16 --- a/drivers/gpu/drm/drm_color_mgmt.c
17 +++ b/drivers/gpu/drm/drm_color_mgmt.c
18 @@ -330,8 +330,6 @@ static int drm_crtc_legacy_gamma_set(str
19 memcmp(crtc_state->gamma_lut->data, blob_data, blob->length))
20 replaced |= drm_property_replace_blob(&crtc_state->gamma_lut,
21 use_gamma_lut ? blob : NULL);
22 - else
23 - drm_property_blob_put(blob);
24 crtc_state->color_mgmt_changed |= replaced;
25
26 ret = drm_atomic_commit(state);