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 B530118FC99; Tue, 10 Sep 2024 10:00:39 +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=1725962439; cv=none; b=R6evJBr0rGPN8qDGR5HCvnrPZTYDUVlDR5IGir1akUqrmsNU/bBz3Qz9fhsz9zDwmocDrrSALGvgGEeCKa/bCA3szuzLz7mrInmpvsWCBTs/6QnYrLCwRH/rfyb54qCkyVi/ZDEz6PABYKgSNHhQD2TUyRpfSyrp2kaGauijiLw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725962439; c=relaxed/simple; bh=7eST+JtMmltYohE6OFgBe2L9m/IxpNjmHM++9Kkh8X0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tNLJDa+sPbuLPCJ1LXSzPoj0wlvKCVN8TrBSw9UmBYW2LOgNevPjuTH8KHX/xSFE2V8BamoPcAOQT9IQrEoU/hO5Qku3PoHXR68lL6xn2NgTUAWsJbswVbBftUvCjy3/wHAorJU8G+qyhq324mpq8qqRLJPHlIfGELHdMT1pThk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qvjhztpH; 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="qvjhztpH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B15AC4CEC3; Tue, 10 Sep 2024 10:00:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725962439; bh=7eST+JtMmltYohE6OFgBe2L9m/IxpNjmHM++9Kkh8X0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qvjhztpHoXGxJ6yA7QEXOcd5u9qR/141nHto7YJ0BhUF4teojSrhcMRJeqQbWNKnp Mn+8R6W16MsCrP1YNMISmzfUAi+YJYN6d673qNIFJ7bPMfr24tcCuIeK67zXozb5HX nmXhxsTrxbGImA5DjQzRctrK2lCmRLArJdZErGbU= 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 5.4 009/121] drm/amd/display: Fix Coverity INTEGER_OVERFLOW within dal_gpio_service_create Date: Tue, 10 Sep 2024 11:31:24 +0200 Message-ID: <20240910092546.188443164@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240910092545.737864202@linuxfoundation.org> References: <20240910092545.737864202@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 5.4-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 f76ec0dd29e7..a61cec470d28 100644 --- a/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c +++ b/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c @@ -58,7 +58,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); @@ -114,7 +114,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