From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Aric Cyr <aric.cyr@amd.com>,
airlied@linux.ie, Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
Samson.Tam@amd.com,
Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>,
wyatt.wood@amd.com, Jun.Lei@amd.com, hanghong.ma@amd.com,
Jimmy Kizito <Jimmy.Kizito@amd.com>,
Sasha Levin <sashal@kernel.org>,
wenjing.liu@amd.com, amd-gfx@lists.freedesktop.org,
sunpeng.li@amd.com, Jerry.Zuo@amd.com, george.shen@amd.com,
harry.wentland@amd.com, stylon.wang@amd.com, Anson.Jacob@amd.com,
dri-devel@lists.freedesktop.org, paul.hsieh@amd.com,
agustin.gutierrez@amd.com, Wesley.Chalmers@amd.com,
qingqing.zhuo@amd.com, Xinhui.Pan@amd.com,
christian.koenig@amd.com, vladimir.stempen@amd.com,
daniel@ffwll.ch, Alex Deucher <alexander.deucher@amd.com>,
nicholas.kazlauskas@amd.com
Subject: [PATCH AUTOSEL 5.14 027/138] drm/amd/display: Fix null pointer dereference for encoders
Date: Mon, 8 Nov 2021 12:44:53 -0500 [thread overview]
Message-ID: <20211108174644.1187889-27-sashal@kernel.org> (raw)
In-Reply-To: <20211108174644.1187889-1-sashal@kernel.org>
From: Jimmy Kizito <Jimmy.Kizito@amd.com>
[ Upstream commit 60f39edd897ea134a4ddb789a6795681691c3183 ]
[Why]
Links which are dynamically assigned link encoders have their link
encoder set to NULL.
[How]
Check that a pointer to a link_encoder object is non-NULL before using
it.
Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Reviewed-by: Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Jimmy Kizito <Jimmy.Kizito@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 +-
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index 3c8da3665a274..7b418f3f9291c 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -4681,7 +4681,7 @@ enum dc_status dp_set_fec_ready(struct dc_link *link, bool ready)
link_enc->funcs->fec_set_ready(link_enc, true);
link->fec_state = dc_link_fec_ready;
} else {
- link_enc->funcs->fec_set_ready(link->link_enc, false);
+ link_enc->funcs->fec_set_ready(link_enc, false);
link->fec_state = dc_link_fec_not_ready;
dm_error("dpcd write failed to set fec_ready");
}
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
index 75fa4adcf5f40..da7c906ba5eb5 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
@@ -1522,7 +1522,7 @@ void dcn10_power_down_on_boot(struct dc *dc)
for (i = 0; i < dc->link_count; i++) {
struct dc_link *link = dc->links[i];
- if (link->link_enc->funcs->is_dig_enabled &&
+ if (link->link_enc && link->link_enc->funcs->is_dig_enabled &&
link->link_enc->funcs->is_dig_enabled(link->link_enc) &&
dc->hwss.power_down) {
dc->hwss.power_down(dc);
--
2.33.0
prev parent reply other threads:[~2021-11-09 1:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20211108174644.1187889-1-sashal@kernel.org>
2021-11-08 17:44 ` [PATCH AUTOSEL 5.14 026/138] drm/amdgpu: Fix MMIO access page fault Sasha Levin
2021-11-08 17:44 ` Sasha Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211108174644.1187889-27-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Anson.Jacob@amd.com \
--cc=Jerry.Zuo@amd.com \
--cc=Jimmy.Kizito@amd.com \
--cc=Jun.Lei@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Samson.Tam@amd.com \
--cc=Wesley.Chalmers@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=agustin.gutierrez@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=aric.cyr@amd.com \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=george.shen@amd.com \
--cc=hanghong.ma@amd.com \
--cc=harry.wentland@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=meenakshikumar.somasundaram@amd.com \
--cc=nicholas.kazlauskas@amd.com \
--cc=paul.hsieh@amd.com \
--cc=qingqing.zhuo@amd.com \
--cc=stable@vger.kernel.org \
--cc=stylon.wang@amd.com \
--cc=sunpeng.li@amd.com \
--cc=vladimir.stempen@amd.com \
--cc=wenjing.liu@amd.com \
--cc=wyatt.wood@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox