From: jsg Date: Mon, 9 Sep 2024 08:56:25 +0000 (+0000) Subject: drm/amd/display: Fix Coverity INTEGER_OVERFLOW within dal_gpio_service_create X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4dffd2f41b5f094a6904331cec9bf3b5d08cc1c6;p=openbsd 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 --- 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]); }