disp: msm: sde: fix null dereference in sde_encoder_destroy

Avoid use-after-free for phys_encs.

Change-Id: Ic44013dbe7099c3ef22338f4531fb42a55bb38ef
Signed-off-by: Venkata Prahlad Valluru <quic_vvalluru@quicinc.com>
This commit is contained in:
Venkata Prahlad Valluru
2023-11-27 12:45:45 +05:30
committed by Prahlad Valluru
parent 21dabac3b4
commit a2ed5b2400

View File

@@ -750,6 +750,7 @@ void sde_encoder_destroy(struct drm_encoder *drm_enc)
phys->ops.destroy(phys);
--sde_enc->num_phys_encs;
sde_enc->phys_vid_encs[i] = NULL;
sde_enc->phys_encs[i] = NULL;
}
phys = sde_enc->phys_cmd_encs[i];
@@ -757,6 +758,7 @@ void sde_encoder_destroy(struct drm_encoder *drm_enc)
phys->ops.destroy(phys);
--sde_enc->num_phys_encs;
sde_enc->phys_cmd_encs[i] = NULL;
sde_enc->phys_encs[i] = NULL;
}
phys = sde_enc->phys_encs[i];