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
7 The vc4_hvs_dlist_allocation structure has a list that we don't
8 initialize when we allocate a new instance.
10 This makes any call reading the list structure (such as list_empty) fail
11 with a NULL pointer dereference.
13 Let's make sure our list is always initialized.
15 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
17 drivers/gpu/drm/vc4/vc4_hvs.c | 2 ++
18 1 file changed, 2 insertions(+)
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
24 return ERR_PTR(-ENOMEM);
26 + INIT_LIST_HEAD(&alloc->node);
28 spin_lock_irqsave(&hvs->mm_lock, flags);
29 ret = drm_mm_insert_node(&hvs->dlist_mm, &alloc->mm_node,