We use "mc" without initializing it if scaling is not necessary.
Fixes: 28ce675b7474 ("drm: mali-dp: Add plane upscaling support") Signed-off-by: Dan Carpenter dan.carpenter@oracle.com
diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 33c5ef96ced0..82f9eaa5ee33 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -148,6 +148,8 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, if (!crtc_state) return -EINVAL;
+ mc = to_malidp_crtc_state(crtc_state); + clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, @@ -166,8 +168,6 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, if (mp->layer->id & (DE_SMART | DE_GRAPHICS2)) return -EINVAL;
- mc = to_malidp_crtc_state(crtc_state); - mc->scaled_planes_mask |= mp->layer->id; /* Defer scaling requirements calculation to the crtc check. */ return 0;
On 09/12/17 11:46, Dan Carpenter wrote:
We use "mc" without initializing it if scaling is not necessary.
Fixes: 28ce675b7474 ("drm: mali-dp: Add plane upscaling support") Signed-off-by: Dan Carpenter dan.carpenter@oracle.com
diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 33c5ef96ced0..82f9eaa5ee33 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -148,6 +148,8 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, if (!crtc_state) return -EINVAL;
- mc = to_malidp_crtc_state(crtc_state);
- clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip,
@@ -166,8 +168,6 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, if (mp->layer->id & (DE_SMART | DE_GRAPHICS2)) return -EINVAL;
- mc = to_malidp_crtc_state(crtc_state);
- mc->scaled_planes_mask |= mp->layer->id; /* Defer scaling requirements calculation to the crtc check. */ return 0;
Reviewed-by: Mihail Atanassov Mihail.Atanassov@arm.com
dri-devel@lists.freedesktop.org