summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-09-09 08:56:26 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-09-09 08:56:26 +0000
commit95430e8240f8ff8726a464bafb3108b4aa777afc (patch)
treedb5fcaa86ffa104600f65ffebde9d443fc2ca699 /sys/dev/pci
parentb28ea499fa6b8138864dc7d4755a690b90fd2021 (diff)
drm/amd/display: Fix Coverity INTEGER_OVERFLOW within dal_gpio_service_create
From Hersen Wu 313d3dd4ca0e898897f4255a4c1f3d9c1f400fe2 in linux-6.6.y/6.6.50 c6077aa66fa230d12f37fef01161ef080d13b726 in mainline linux
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/drm/amd/display/dc/gpio/gpio_service.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/amd/display/dc/gpio/gpio_service.c b/sys/dev/pci/drm/amd/display/dc/gpio/gpio_service.c
index 2f8ca831afa..f2037d78f71 100644
--- a/sys/dev/pci/drm/amd/display/dc/gpio/gpio_service.c
+++ b/sys/dev/pci/drm/amd/display/dc/gpio/gpio_service.c
@@ -56,7 +56,7 @@ struct gpio_service *dal_gpio_service_create(
struct dc_context *ctx)
{
struct gpio_service *service;
- uint32_t index_of_id;
+ int32_t index_of_id;
service = kzalloc(sizeof(struct gpio_service), GFP_KERNEL);
@@ -112,7 +112,7 @@ struct gpio_service *dal_gpio_service_create(
return service;
failure_2:
- while (index_of_id) {
+ while (index_of_id > 0) {
--index_of_id;
kfree(service->busyness[index_of_id]);
}