mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-06 17:35:20 +02:00
drm/amd/display: Check link_res->hpo_dp_link_enc before using it
[ Upstream commit 0beca868cd
]
[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 <rodrigo.siqueira@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
42d31a3364
commit
be2ca7a2c1
|
@ -28,6 +28,8 @@
|
||||||
#include "dccg.h"
|
#include "dccg.h"
|
||||||
#include "clk_mgr.h"
|
#include "clk_mgr.h"
|
||||||
|
|
||||||
|
#define DC_LOGGER link->ctx->logger
|
||||||
|
|
||||||
void set_hpo_dp_throttled_vcp_size(struct pipe_ctx *pipe_ctx,
|
void set_hpo_dp_throttled_vcp_size(struct pipe_ctx *pipe_ctx,
|
||||||
struct fixed31_32 throttled_vcp_size)
|
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,
|
const struct link_resource *link_res,
|
||||||
enum signal_type signal)
|
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->link_disable(link_res->hpo_dp_link_enc);
|
||||||
link_res->hpo_dp_link_enc->funcs->disable_link_phy(
|
link_res->hpo_dp_link_enc->funcs->disable_link_phy(
|
||||||
link_res->hpo_dp_link_enc, signal);
|
link_res->hpo_dp_link_enc, signal);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user