openwrt/target/linux/bcm27xx/patches-6.6/950-0575-vc4_drv-Avoid-panic-when-booted-with-no-kms.patch
Álvaro Fernández Rojas 8c405cdccc bcm27xx: add 6.6 kernel patches
The patches were generated from the RPi repo with the following command:
git format-patch v6.6.34..rpi-6.1.y

Some patches needed rebasing and, as usual, the applied and reverted, wireless
drivers, Github workflows, READMEs and defconfigs patches were removed.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-06-18 18:52:49 +02:00

30 lines
877 B
Diff

From c46109f56742a31f1c534e13e43b0aa707a47f87 Mon Sep 17 00:00:00 2001
From: Dom Cobley <popcornmix@gmail.com>
Date: Mon, 17 Apr 2023 15:21:41 +0100
Subject: [PATCH 0575/1085] vc4_drv: Avoid panic when booted with no kms
If kms/fkms overlay is not present we have no matching drivers
and so match is NULL.
It is not safe to call component_master_add_with_match with a null match argument.
So don't do that
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
---
drivers/gpu/drm/vc4/vc4_drv.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/gpu/drm/vc4/vc4_drv.c
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
@@ -454,6 +454,9 @@ static int vc4_platform_drm_probe(struct
vc4_match_add_drivers(dev, &match,
component_drivers, ARRAY_SIZE(component_drivers));
+ if (!match)
+ return -ENODEV;
+
return component_master_add_with_match(dev, &vc4_drm_ops, match);
}