[PATCH] drm/radeon: fix uninitialized variable

Jerome Glisse j.glisse at gmail.com
Tue Feb 28 15:23:30 PST 2012


On Tue, 2012-02-28 at 23:19 +0100, Christian König wrote:
> Without this fix the driver randomly treats
> textures as arrays and I'm really wondering
> why gcc isn't complaining about it.
> 
> Signed-off-by: Christian König <deathsimple at vodafone.de>
> ---
>  drivers/gpu/drm/radeon/r600_cs.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
> index 38ce5d0..387fcc9 100644
> --- a/drivers/gpu/drm/radeon/r600_cs.c
> +++ b/drivers/gpu/drm/radeon/r600_cs.c
> @@ -1304,6 +1304,7 @@ static int r600_check_texture_resource(struct radeon_cs_parser *p,  u32 idx,
>  	h0 = G_038004_TEX_HEIGHT(word1) + 1;
>  	d0 = G_038004_TEX_DEPTH(word1);
>  	nfaces = 1;
> +	array = 0;
>  	switch (G_038000_DIM(word0)) {
>  	case V_038000_SQ_TEX_DIM_1D:
>  	case V_038000_SQ_TEX_DIM_2D:

I think if array field are properly initialized this shouldn't be an
issue. But anyway this patch is needed.

Reviewed-by: Jerome Glisse <jglisse at redhat.com>



More information about the dri-devel mailing list