From 978edfa200e842c31810218eb6a419f281cd2c65 Mon Sep 17 00:00:00 2001 From: Samantha Tran Date: Mon, 26 Apr 2021 20:19:32 -0700 Subject: [PATCH] disp: msm: sde: check for valid pointer before accessing This change initializes a variable as null to account for cases when it is not set. This change also ensures proper pointer checks before attempting to access function pointer. Change-Id: I2f06a0877293668e80bee9d9b82d412476dc5184 Signed-off-by: Samantha Tran --- msm/sde/sde_encoder_phys_cmd.c | 2 +- msm/sde/sde_plane.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/msm/sde/sde_encoder_phys_cmd.c b/msm/sde/sde_encoder_phys_cmd.c index 092a5a7e16..253dc8d400 100644 --- a/msm/sde/sde_encoder_phys_cmd.c +++ b/msm/sde/sde_encoder_phys_cmd.c @@ -409,7 +409,7 @@ static void sde_encoder_phys_cmd_cont_splash_mode_set( &cmd_enc->autorefresh.cfg); } - if (hw_intf->ops.reset_counter) + if (hw_intf && hw_intf->ops.reset_counter) hw_intf->ops.reset_counter(hw_intf); } diff --git a/msm/sde/sde_plane.c b/msm/sde/sde_plane.c index a57382b3ca..c8e0fa1d11 100644 --- a/msm/sde/sde_plane.c +++ b/msm/sde/sde_plane.c @@ -2347,7 +2347,7 @@ static void _sde_plane_get_max_downscale_limits(struct sde_plane *psde, { bool rotated, has_predown, default_scale; const struct sde_sspp_sub_blks *sblk; - struct sde_hw_inline_pre_downscale_cfg *pd; + struct sde_hw_inline_pre_downscale_cfg *pd = NULL; rotated = pstate->rotation & DRM_MODE_ROTATE_90; sblk = psde->pipe_sblk;