d250dd4e1e15bfffb6fadd34dea56d62d4adbdd4
[openwrt/staging/blocktrron.git] /
1 From bc1c5829ecc698e41379f461f1fd7e8d600b879f Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Wed, 25 Jan 2023 12:38:37 +0100
4 Subject: [PATCH 0031/1085] drm/vc4: hvs: Initialize the dlist allocation list
5 entry
6
7 The vc4_hvs_dlist_allocation structure has a list that we don't
8 initialize when we allocate a new instance.
9
10 This makes any call reading the list structure (such as list_empty) fail
11 with a NULL pointer dereference.
12
13 Let's make sure our list is always initialized.
14
15 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
16 ---
17 drivers/gpu/drm/vc4/vc4_hvs.c | 2 ++
18 1 file changed, 2 insertions(+)
19
20 --- a/drivers/gpu/drm/vc4/vc4_hvs.c
21 +++ b/drivers/gpu/drm/vc4/vc4_hvs.c
22 @@ -452,6 +452,8 @@ vc4_hvs_alloc_dlist_entry(struct vc4_hvs
23 if (!alloc)
24 return ERR_PTR(-ENOMEM);
25
26 + INIT_LIST_HEAD(&alloc->node);
27 +
28 spin_lock_irqsave(&hvs->mm_lock, flags);
29 ret = drm_mm_insert_node(&hvs->dlist_mm, &alloc->mm_node,
30 dlist_count);