Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1873018lql; Wed, 13 Mar 2024 10:22:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVPh28zTPK1Y9r/5Qh48F9KCGN505IL6O9xs2dQyxFwx9/SP3FR44rzp8CA3DkMTkzBf+scoArhiApTQMrr1SY/vccGKJzPI/3yDiOvGQ== X-Google-Smtp-Source: AGHT+IHWdv+ByOjUeINFTOISY9VS6PmgXZIo428LPmKpSmxuDl3OEAHY28rIBXhuAc6HQU9qcDOk X-Received: by 2002:a05:6a20:2591:b0:1a3:3521:c640 with SMTP id k17-20020a056a20259100b001a33521c640mr1911260pzd.60.1710350567162; Wed, 13 Mar 2024 10:22:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710350567; cv=pass; d=google.com; s=arc-20160816; b=ofOT3+T1Rsvj6SHc+EGNeoh1NUK0aVBiAeZOGj4wznw7JmTEX2qTBgRerGU6oOTj2l +zk6YuRHoHj3KhoFl2Ife9wZqxW1dYiDYLY1uOv1kcN/MMGaw/shYGPGgfl44awg+AT4 D58cjxkxp5EXIUt24LkEcfSsJVwlun9t+eo+1VBLMqhnF1/ygHEXwaVRjdHCf6A5WO8l PQxH531uJ4bTobih0Y45X3RjbWcQo91bGROT2dgrrvYBp3jgPla+gnLpV6S5BiCgeOO/ xUBqgTgVJyZhjGIzoIw622erGBE69zfPduEKXBL4hvgN7JPDaN3oPRCddLYBgfgP0qKO ipMQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=bA38iC+PHsgb4wnEJbf+HOqAkBRv5PLT7QR7rJ5ywec=; fh=j2R42p+E2VVBHHmnDgQPg652lerXi4XwpPyygoZi9n8=; b=al4UblskHsZeUHBmxjL5sHgPSvfjVKTRsT9LP0tyf9Gjffe/BCGxVMtJBG07Q5Q1Y6 8FW9d0rRVmqHVokwM+uKKUirFbCOY40+v4fuMEciTRV+X2zy5OisCttm59kLxiPLO7pS TIJnf0U+Zqtr3x1nh2ukCXRvVL23zQMbmOiGVMTMa1CvzA7ZIEV9cX27ujMGHJx+Ff0o iBk7fnPza/kleQKX1zEOExFY2jLuNfdcZ+nP8q+zAOdhgSYIPcUyu+pgCtI/KBgBNIIw q4ilcBiSSq18b/AYSZIiSg3vzaH3ul1Ug5GtsvukqvZLwg6XKtVZ/DuR07rThV27xDtx OO3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hIF92ouT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101902-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101902-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id b13-20020a63930d000000b005dc5576e634si9537370pge.896.2024.03.13.10.22.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:22:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101902-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hIF92ouT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101902-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101902-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id BBE8DB23A0D for ; Wed, 13 Mar 2024 17:11:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8556861667; Wed, 13 Mar 2024 16:40:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hIF92ouT" 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 AAEEF81219; Wed, 13 Mar 2024 16:40: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=1710348039; cv=none; b=oFCXUx8k2uUa/WebAC69H7y8HNfam2MKT+uuymElAdPgOJVNCxR9bfSzF2I/9f+6R9S/p1zJ7W6IQh7kzK0fD7bytXb9scz0l7OClZSfYXPEMGb7tz3EHlSBqa/HCFMntdIQZr2cGuuXfzXrpj1UQHiDXG4t09KFsa6bllp0PV4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348039; c=relaxed/simple; bh=a6IhWdWXdOwczKFyKIuSC60sB+c8ssghEzrNz4Ee4UM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=URzWRDM7FhhcdS/SBbHli8uIn8OswzJzSzYOQeLu6sFpw76XZa0IC1LnN72OhhNv6bmkw/yAXFYT8XDyuOlszy5LuXYY7TLLiI8xkWqRPed2wWtXWkltB2PQDfXAGmlsatO/sQubNp0T0vUQsSIbtuQNflG+5Rj5Un7LQsXjFFk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hIF92ouT; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F392C433A6; Wed, 13 Mar 2024 16:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348039; bh=a6IhWdWXdOwczKFyKIuSC60sB+c8ssghEzrNz4Ee4UM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hIF92ouT9ND30z8+QINzYEm3UFzJ7/cg7/+vpVqpAG1oKXMsXOtDNAUc6fyizy15S jIsBBPlXh21a07fTGGJuje06+2db+xLfpSZ1aVeYyyriPpdtefejI5O0cHq9RLKldq n1W6+1QDEtzSASajSopJasMwbdJu/9zenq8VuLpslgNSl/wf9YWmLivAZnC3BqDeLS noxMeKV6P4Sp4f+FZc0EsC6sH6Phin716n/orz+Y15g0D/a88PBehFsGg+x/MqbU7Y u59CQJ0XVWi7IKmvwUhGV1R52jYVcV/V5kZWRGQnoVCR9vv/QTbJ9sRjsyQ90v8ZIs Z6fOHstMdRRcQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Srinivasan Shanmugam , Jerry Zuo , Jun Lei , Wayne Lin , Aurabindo Pillai , Rodrigo Siqueira , Hamza Mahfooz , Alex Deucher , Sasha Levin Subject: [PATCH 6.1 34/71] drm/amd/display: Fix uninitialized variable usage in core_link_ 'read_dpcd() & write_dpcd()' functions Date: Wed, 13 Mar 2024 12:39:20 -0400 Message-ID: <20240313163957.615276-35-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313163957.615276-1-sashal@kernel.org> References: <20240313163957.615276-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.82-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-6.1.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 6.1.82-rc1 X-KernelTest-Deadline: 2024-03-15T16:39+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Srinivasan Shanmugam [ Upstream commit a58371d632ebab9ea63f10893a6b6731196b6f8d ] 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: Sasha Levin --- drivers/gpu/drm/amd/display/dc/core/dc_link_dpcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dpcd.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dpcd.c index af110bf9470fa..aefca9756dbe8 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dpcd.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dpcd.c @@ -202,7 +202,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; @@ -231,7 +231,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); -- 2.43.0