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 036F2159591; Mon, 29 Jan 2024 17:11:01 +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=1706548261; cv=none; b=iyrb2/Kc9E0XHkyp/5sVmdmn7rx3TXyQZ5Hcl7bREbdD0V4Wirt5rvFK3Kf4BqXXipJtWJO1RsRzt5JdKBhWKjAiXclBnuFlpH/iAc7eQEYULuT2/hb83yfCN0dVQqq7hWYgmwlQHQfHBJI4xac+1qz1/VqqK9cQhiuXbAl51cU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706548261; c=relaxed/simple; bh=liap3NySlBRnj9zaJcXbCXnL2sNNjht6CzYicosHUqw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tuILwpIWERMFVBevmPLZens60YkwvzY0H+ZY7tZKwxXGxKH1Uf7fwTSuscYpwZVArYCzY0hrFUvAlExIfEEI9pn7Kg4/gxhbvPASRUFd02OG8o2WbShD0QOIujYzeB+hlmuao3FPn1Vi+UjooeG1cerz0IoPr9bSAA5ghtdx3UU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HCoeu8tY; 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="HCoeu8tY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C253BC433C7; Mon, 29 Jan 2024 17:11:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1706548260; bh=liap3NySlBRnj9zaJcXbCXnL2sNNjht6CzYicosHUqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HCoeu8tYspV1t3asUnjApLHE7/kyfknt8cd5RV0gKCmguriEL3TMDTh+krMIHRc5h 3YZ6eu/FKgO5uh9J4/6a2yQSEIwpgRpqoow7C9PCedXvGy6baINVXYCrI0F4UP/NOZ NDTmHfD1C4K6/0T6kodewH2opI2iVF2dO2hCZpBU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jerry Zuo , Jun Lei , Wayne Lin , Aurabindo Pillai , Rodrigo Siqueira , Hamza Mahfooz , Srinivasan Shanmugam , Alex Deucher Subject: [PATCH 6.7 279/346] drm/amd/display: Fix uninitialized variable usage in core_link_ read_dpcd() & write_dpcd() functions Date: Mon, 29 Jan 2024 09:05:10 -0800 Message-ID: <20240129170024.583108937@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240129170016.356158639@linuxfoundation.org> References: <20240129170016.356158639@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 6.7-stable review patch. If anyone has any objections, please let me know. ------------------ From: Srinivasan Shanmugam commit a58371d632ebab9ea63f10893a6b6731196b6f8d upstream. The 'status' variable in 'core_link_read_dpcd()' & 'core_link_write_dpcd()' was uninitialized. Thus, initializing 'status' variable to 'DC_ERROR_UNEXPECTED' by default. Fixes the below: drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dpcd.c:226 core_link_read_dpcd() error: uninitialized symbol 'status'. drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dpcd.c:248 core_link_write_dpcd() error: uninitialized symbol 'status'. Cc: stable@vger.kernel.org Cc: Jerry Zuo Cc: Jun Lei Cc: Wayne Lin Cc: Aurabindo Pillai Cc: Rodrigo Siqueira Cc: Hamza Mahfooz Signed-off-by: Srinivasan Shanmugam Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c @@ -205,7 +205,7 @@ enum dc_status core_link_read_dpcd( uint32_t extended_size; /* size of the remaining partitioned address space */ uint32_t size_left_to_read; - enum dc_status status; + enum dc_status status = DC_ERROR_UNEXPECTED; /* size of the next partition to be read from */ uint32_t partition_size; uint32_t data_index = 0; @@ -234,7 +234,7 @@ enum dc_status core_link_write_dpcd( { uint32_t partition_size; uint32_t data_index = 0; - enum dc_status status; + enum dc_status status = DC_ERROR_UNEXPECTED; while (size) { partition_size = dpcd_get_next_partition_size(address, size);