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 164CB1D049F; Wed, 2 Oct 2024 13:28:48 +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=1727875728; cv=none; b=S7r4r4XL3mzQVd+OzQWPZU/aPclNa5oo03DRIRqBrba49cDsqPalyEBFvIPtszvdAWuNRvcvDn3MP/YE4tlr3xYlNPCdONq+Lt5FctlhJIeUMEE5Aa+3eGFQBv5moKi6025/50D2V9s95twgr8P8YpCQJDwE37rLgyIhCDU6Nq4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727875728; c=relaxed/simple; bh=SWOpoiz8hRa4pCyVl5T+6LwICxPe9wZXuRhUZpHwwe0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g/yYKqTteJlOTI1LVV4cTSFtzigtLIw4BoPOerBq4BfrPHMirHEvuRuTDKyNA+QIzrmR1QT9PFVemRCIGJMokMXZMvu7Dq7LN0k8HS3+T/CmwY0c6ylXqk4KKKFEC7hv2vBpEa4b2pMHJoCDrma8Kh14UhWRZ2y4B5h0Pkd/AI0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VK7P5EEI; 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="VK7P5EEI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 898E2C4CEC5; Wed, 2 Oct 2024 13:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1727875727; bh=SWOpoiz8hRa4pCyVl5T+6LwICxPe9wZXuRhUZpHwwe0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VK7P5EEIgO5pG7eFd3Iag4UclBr/L7xqf4kOePiVWQnx84XUORNbBRvRdskxmxTrL DHKCAFQfCVaytO/Y9S6L7CobhtSm8xcZ576oI3yG1l507/0zv+RpZcU58rOOlWXxcg aU/TVmo8afXq4Uzu/60tekgd+n9LKl4bla5Y8EJI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Rodrigo Siqueira , Jerry Zuo , Alex Hung , Daniel Wheeler , Alex Deucher , Sasha Levin Subject: [PATCH 6.11 201/695] drm/amd/display: Check link_res->hpo_dp_link_enc before using it Date: Wed, 2 Oct 2024 14:53:19 +0200 Message-ID: <20241002125830.486435902@linuxfoundation.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241002125822.467776898@linuxfoundation.org> References: <20241002125822.467776898@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.11-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alex Hung [ Upstream commit 0beca868cde8742240cd0038141c30482d2b7eb8 ] [WHAT & HOW] Functions dp_enable_link_phy and dp_disable_link_phy can pass link_res without initializing hpo_dp_link_enc and it is necessary to check for null before dereferencing. This fixes 2 FORWARD_NULL issues reported by Coverity. Reviewed-by: Rodrigo Siqueira Signed-off-by: Jerry Zuo Signed-off-by: Alex Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- .../gpu/drm/amd/display/dc/link/hwss/link_hwss_hpo_dp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_hpo_dp.c b/drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_hpo_dp.c index e1257404357b1..d0148f10dfc0a 100644 --- a/drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_hpo_dp.c +++ b/drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_hpo_dp.c @@ -28,6 +28,8 @@ #include "dccg.h" #include "clk_mgr.h" +#define DC_LOGGER link->ctx->logger + void set_hpo_dp_throttled_vcp_size(struct pipe_ctx *pipe_ctx, struct fixed31_32 throttled_vcp_size) { @@ -124,6 +126,11 @@ void disable_hpo_dp_link_output(struct dc_link *link, const struct link_resource *link_res, enum signal_type signal) { + if (!link_res->hpo_dp_link_enc) { + DC_LOG_ERROR("%s: invalid hpo_dp_link_enc\n", __func__); + return; + } + link_res->hpo_dp_link_enc->funcs->link_disable(link_res->hpo_dp_link_enc); link_res->hpo_dp_link_enc->funcs->disable_link_phy( link_res->hpo_dp_link_enc, signal); -- 2.43.0