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 816AA18EFEE; Tue, 10 Sep 2024 10:39:16 +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=1725964756; cv=none; b=J6yn69986tXrZKvflGFxhXjXqP4ti65G0Vy/L46H2XE5VeFwSA8VHeqRdykqDi8WyuDrCt8iqcWb/p2CmZZlp7lLe4bZ3HLPbfy/OexYM8cjcJDJYk8wyZOE1FMx5ZEu6cSAzb/917K9mZaiytkS0NFfUCyWuHO6QvGmVN1uyKA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725964756; c=relaxed/simple; bh=TKbokKB7HTXKMqGa6Ra6J74OJlsYHJdWEjssC2mPZYk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s/jxsYr7SJthExua13VIAeWlLE4FMd+2aYa72YVoMIFKQ4beQq5hO1WltZj5FlhtHmd196HO3Nnz3nYplnJ8TFUwpSLyPbwJG3QVLJ01WuLeW6NCyHTsv1ak6K711TUn7JyM+6RNivtI1xZU41dA3FXH5VnCA/jgBRUcdyj0CmM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1SiBAJE/; 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="1SiBAJE/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09C15C4CEC3; Tue, 10 Sep 2024 10:39:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725964756; bh=TKbokKB7HTXKMqGa6Ra6J74OJlsYHJdWEjssC2mPZYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1SiBAJE/KZ9+B2az8wZcjYN5AWqBtQxKNcT3NGj7JfZzrLdUe5dTy9uUwgguORiwB fXNaDB9mQAhggqB1XXgwC1XNzpBR2B8chQ5IpATE351JVGNhFi7UMZCYpL0WVN2aOn o+iTJ17M704HK9ke9Zs3Zhy2j/EfC6AKMcLANM/c= 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.10 020/186] drm/amd/display: Fix Coverity INTEGER_OVERFLOW within dal_gpio_service_create Date: Tue, 10 Sep 2024 11:31:55 +0200 Message-ID: <20240910092555.474225756@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240910092554.645718780@linuxfoundation.org> References: <20240910092554.645718780@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.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 a7c92c64490c..a5de27908914 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