bcm27xx: update 6.1 patches to latest version
[openwrt/staging/nbd.git] / target / linux / bcm27xx / patches-6.1 / 950-0928-vc4_drv-Avoid-panic-when-booted-with-no-kms.patch
1 From 0f5fd4538774aa6c936bb8fc78611c3113bf19d7 Mon Sep 17 00:00:00 2001
2 From: Dom Cobley <popcornmix@gmail.com>
3 Date: Mon, 17 Apr 2023 15:21:41 +0100
4 Subject: [PATCH] vc4_drv: Avoid panic when booted with no kms
5
6 If kms/fkms overlay is not present we have no matching drivers
7 and so match is NULL.
8
9 It is not safe to call component_master_add_with_match with a null match argument.
10
11 So don't do that
12
13 Signed-off-by: Dom Cobley <popcornmix@gmail.com>
14 ---
15 drivers/gpu/drm/vc4/vc4_drv.c | 3 +++
16 1 file changed, 3 insertions(+)
17
18 --- a/drivers/gpu/drm/vc4/vc4_drv.c
19 +++ b/drivers/gpu/drm/vc4/vc4_drv.c
20 @@ -456,6 +456,9 @@ static int vc4_platform_drm_probe(struct
21 vc4_match_add_drivers(dev, &match,
22 component_drivers, ARRAY_SIZE(component_drivers));
23
24 + if (!match)
25 + return -ENODEV;
26 +
27 return component_master_add_with_match(dev, &vc4_drm_ops, match);
28 }
29