summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorClarence Ip <cip@codeaurora.org>2016-07-18 19:07:24 -0400
committerDhaval Patel <pdhaval@codeaurora.org>2016-08-01 11:58:15 -0700
commitc2d2bf6758a3906cebd3245efd29fac71047bed0 (patch)
tree53fa32a6e0f15b662370f682529bc3ab5f5a1fd1 /drivers/gpu
parent86c14fe760abdcba3443857a663963db522e0285 (diff)
drm/msm/sde: avoid dereferencing scaler blob if null state
Add checks to avoid dereferencing the user scaler blob if the plane state is null, which is possible if the scaler configuration is requested internally. Change-Id: I497cdd8e2d35afa842451321eee98ae3b9c34bf2 Signed-off-by: Clarence Ip <cip@codeaurora.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/msm/sde/sde_plane.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/msm/sde/sde_plane.c b/drivers/gpu/drm/msm/sde/sde_plane.c
index 99d1d9349f8b..5bc99ad36bfc 100644
--- a/drivers/gpu/drm/msm/sde/sde_plane.c
+++ b/drivers/gpu/drm/msm/sde/sde_plane.c
@@ -477,11 +477,11 @@ static void _sde_plane_setup_scaler(struct sde_plane *psde,
memset(pe, 0, sizeof(struct sde_hw_pixel_ext));
/* get scaler config from user space */
- /* get scaler config from user space */
- sc_u = msm_property_get_blob(&psde->property_info,
- pstate->property_blobs,
- &sc_u_size,
- PLANE_PROP_SCALER);
+ if (pstate)
+ sc_u = msm_property_get_blob(&psde->property_info,
+ pstate->property_blobs,
+ &sc_u_size,
+ PLANE_PROP_SCALER);
if (sc_u) {
switch (sc_u->version) {
case SDE_DRM_SCALER_V1: