aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev/simplefb.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2021-12-13 10:48:46 +0100
committerIngo Molnar <mingo@kernel.org>2021-12-13 10:48:46 +0100
commit6773cc31a9bb5122fd5c288f73ca006ad20a6c17 (patch)
tree730ec8bcc0a5ddd5030268bb3ffd4945d34728c1 /drivers/video/fbdev/simplefb.c
parentfutex: Fix additional regressions (diff)
parentLinux 5.16-rc5 (diff)
downloadlinux-dev-6773cc31a9bb5122fd5c288f73ca006ad20a6c17.tar.xz
linux-dev-6773cc31a9bb5122fd5c288f73ca006ad20a6c17.zip
Merge tag 'v5.16-rc5' into locking/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/video/fbdev/simplefb.c')
-rw-r--r--drivers/video/fbdev/simplefb.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
index 62f0ded70681..b63074fd892e 100644
--- a/drivers/video/fbdev/simplefb.c
+++ b/drivers/video/fbdev/simplefb.c
@@ -407,6 +407,17 @@ static int simplefb_probe(struct platform_device *pdev)
struct simplefb_par *par;
struct resource *mem;
+ /*
+ * Generic drivers must not be registered if a framebuffer exists.
+ * If a native driver was probed, the display hardware was already
+ * taken and attempting to use the system framebuffer is dangerous.
+ */
+ if (num_registered_fb > 0) {
+ dev_err(&pdev->dev,
+ "simplefb: a framebuffer is already registered\n");
+ return -EINVAL;
+ }
+
if (fb_get_options("simplefb", NULL))
return -ENODEV;