summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/radeon
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-01-29 01:29:19 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-01-29 01:29:19 +0000
commit6373284037ba462a9dc4c50ac2bf32d9ad5d01b5 (patch)
treef74f9b8dd610085017788d0de65cab77a789ef2b /sys/dev/pci/drm/radeon
parentd76070d600404535841375fed78219a8ed6f4305 (diff)
drm/radeon/r100: Fix integer overflow issues in r100_cs_track_check()
From Nikita Zhandarovich 056484916a131ebad65ee33048ec959f6186befc in linux-6.6.y/6.6.14 b5c5baa458faa5430c445acd9a17481274d77ccf in mainline linux
Diffstat (limited to 'sys/dev/pci/drm/radeon')
-rw-r--r--sys/dev/pci/drm/radeon/r100.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/radeon/r100.c b/sys/dev/pci/drm/radeon/r100.c
index f6c1f54d4df..4efe63d8481 100644
--- a/sys/dev/pci/drm/radeon/r100.c
+++ b/sys/dev/pci/drm/radeon/r100.c
@@ -2321,7 +2321,7 @@ int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track)
switch (prim_walk) {
case 1:
for (i = 0; i < track->num_arrays; i++) {
- size = track->arrays[i].esize * track->max_indx * 4;
+ size = track->arrays[i].esize * track->max_indx * 4UL;
if (track->arrays[i].robj == NULL) {
DRM_ERROR("(PW %u) Vertex array %u no buffer "
"bound\n", prim_walk, i);
@@ -2340,7 +2340,7 @@ int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track)
break;
case 2:
for (i = 0; i < track->num_arrays; i++) {
- size = track->arrays[i].esize * (nverts - 1) * 4;
+ size = track->arrays[i].esize * (nverts - 1) * 4UL;
if (track->arrays[i].robj == NULL) {
DRM_ERROR("(PW %u) Vertex array %u no buffer "
"bound\n", prim_walk, i);