summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/sysfb
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2026-09-07 13:44:24 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2026-09-07 13:44:24 +0200
commit3ab04dcce43cd4fdaed94f08f4e6289be4921ea4 (patch)
tree61229f2644f48301f9d09722e390295cb55a2cf4 /drivers/gpu/drm/sysfb
parenta9f09b5ea0c3db1e2d4c0f8d3ebdd612d8aa0366 (diff)
parentdf2908090cda368b01ff43709f51890076c56157 (diff)
downloadlinux-next-3ab04dcce43cd4fdaed94f08f4e6289be4921ea4.tar.gz
linux-next-3ab04dcce43cd4fdaed94f08f4e6289be4921ea4.zip
Merge drm/drm-next into drm-misc-next
Backmerging to get drm-misc-next up to v7.3-rc2. Requested for commit 3a2c4d55e32a ("treewide: refresh kmalloc_obj() conversions"). Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Diffstat (limited to 'drivers/gpu/drm/sysfb')
-rw-r--r--drivers/gpu/drm/sysfb/ofdrm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/sysfb/ofdrm.c b/drivers/gpu/drm/sysfb/ofdrm.c
index 819aed466727..9d60db45139c 100644
--- a/drivers/gpu/drm/sysfb/ofdrm.c
+++ b/drivers/gpu/drm/sysfb/ofdrm.c
@@ -2,6 +2,7 @@
#include <linux/aperture.h>
#include <linux/of_address.h>
+#include <linux/overflow.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
@@ -238,7 +239,7 @@ static bool is_avivo(u32 vendor, u32 device)
/* This will match most R5xx */
return (vendor == PCI_VENDOR_ID_ATI) &&
((device >= PCI_VENDOR_ID_ATI_R520 && device < 0x7800) ||
- (PCI_VENDOR_ID_ATI_R600 >= 0x9400));
+ (device >= PCI_VENDOR_ID_ATI_R600));
}
static enum ofdrm_model display_get_model_of(struct drm_device *dev, struct device_node *of_node)
@@ -913,7 +914,10 @@ static struct ofdrm_device *ofdrm_device_create(struct drm_driver *drv,
return ERR_PTR(-EINVAL);
}
- fb_size = linebytes * height;
+ if (check_mul_overflow(linebytes, height, &fb_size)) {
+ drm_err(dev, "framebuffer size exceeds maximum\n");
+ return ERR_PTR(-EINVAL);
+ }
/*
* Try to figure out the address of the framebuffer. Unfortunately, Open