From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F40E1922CC; Thu, 5 Sep 2024 09:45:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725529555; cv=none; b=VIoEIrQak8otOww+daH2bY5MqwfkS8jcmPPRPGlgwNmuCXnyTNOOvBqVHfTLf/Xor0isOqNtJ2YjnBkiY0WVRFkjQl32CYEGZ8ieEWw5Ocg+PpX1F0wyZhxH4K6X7YZ1oqH44Xwaly0eFM/t+10kY4YqkzAj7p9KkybICrehmbQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725529555; c=relaxed/simple; bh=5I98RITltI4RuVvMntPXKN1tPC/MKR1ABytOxs8tqWA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iTmsS1gx7lcwJrW7BcT8CP+1apnJCcyVfcyFWcS2UeAOVo97AAybR+ECXBG7cWIPvRH8E3cE9qhyjyQKdh7y06456wYfd429dyToUxgG7rF6d2xzSQAGmIw/9mwnTe+Z1+zb9d0RwPMzmu+IQ0ittgbHqs5j4bRHYsNxshRMS2E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rIRtZh2m; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="rIRtZh2m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5247C4CEC3; Thu, 5 Sep 2024 09:45:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725529555; bh=5I98RITltI4RuVvMntPXKN1tPC/MKR1ABytOxs8tqWA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rIRtZh2mwtrcdGR/Hweu5PrYkzNA3gSbVdzMRBYKoGYl7cnfc5gyFx+Sg+5ZJ0Wz8 UrQudJnS4YE29rIPWS6nqgCbV+1qZC596UV8PWAovp7KR1ct8kCVY6l6AUiqWzYLdJ UESJiifuyczJvp9RIv8a2ZxukDRFN1x4dMMcT/Qc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Harry Wentland , Tom Chung , Hersen Wu , Daniel Wheeler , Alex Deucher , Sasha Levin Subject: [PATCH 6.10 071/184] drm/amd/display: Fix Coverity INTEGER_OVERFLOW within dal_gpio_service_create Date: Thu, 5 Sep 2024 11:39:44 +0200 Message-ID: <20240905093735.015869665@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240905093732.239411633@linuxfoundation.org> References: <20240905093732.239411633@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hersen Wu [ Upstream commit c6077aa66fa230d12f37fef01161ef080d13b726 ] [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 Acked-by: Tom Chung Signed-off-by: Hersen Wu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c | 4 ++-- 1 file 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]); } -- 2.43.0