diff mbox

drm: mali-dp: Uninitialized variable in malidp_se_check_scaling()

Message ID 20171209114612.yrdmsak5rhn4kheq@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Dec. 9, 2017, 11:46 a.m. UTC
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>

Comments

Mihail Atanassov Dec. 11, 2017, 10:10 a.m. UTC | #1
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>
diff mbox

Patch

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;