Skip to content

Commit

Permalink
drm/amd/display: Fix Coverity INTEGER_OVERFLOW within dal_gpio_servic…
Browse files Browse the repository at this point in the history
…e_create

[ Upstream commit c6077aa ]

[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]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Hersen Wu authored and gregkh committed Sep 8, 2024
1 parent ff9730f commit 44def55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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]);
}
Expand Down

0 comments on commit 44def55

Please sign in to comment.