diff options
author | Hersen Wu <[email protected]> | 2024-04-26 11:58:11 -0400 |
---|---|---|
committer | Alex Deucher <[email protected]> | 2024-05-02 16:18:17 -0400 |
commit | c6077aa66fa230d12f37fef01161ef080d13b726 (patch) | |
tree | 270541db97b3eed573f15df47bab914ddd85d2ff | |
parent | 176abbcc71952e23009a6ed194fd203b99646884 (diff) |
drm/amd/display: Fix Coverity INTEGER_OVERFLOW within dal_gpio_service_create
[Why]
For subtraction, coverity reports integer overflow
warning message when variable type is uint32_t.
[How]
Change variable type to int32_t.
Reviewed-by: Harry Wentland <[email protected]>
Acked-by: Tom Chung <[email protected]>
Signed-off-by: Hersen Wu <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c b/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c index d19d5c177022..f344478e9bd4 100644 --- a/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c +++ b/drivers/gpu/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]); } |