[Intel-gfx] [PATCH v1 1/4] drm/i915: Do kunmap if renderstate parsing fails

Daniel Vetter daniel at ffwll.ch
Tue Jul 21 00:26:33 PDT 2015


On Fri, Jul 17, 2015 at 05:08:51PM +0100, Arun Siluvery wrote:
> From: Mika Kuoppala <mika.kuoppala at linux.intel.com>
> 
> Kunmap the renderstate page on error path.
> 
> Reviewed-by: Arun Siluvery <arun.siluvery at linux.intel.com>
> Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>

Queued for -next, thanks for the patch.
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_gem_render_state.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_render_state.c b/drivers/gpu/drm/i915/i915_gem_render_state.c
> index a0201fc..b6492fe 100644
> --- a/drivers/gpu/drm/i915/i915_gem_render_state.c
> +++ b/drivers/gpu/drm/i915/i915_gem_render_state.c
> @@ -96,8 +96,10 @@ static int render_state_setup(struct render_state *so)
>  			s = lower_32_bits(r);
>  			if (so->gen >= 8) {
>  				if (i + 1 >= rodata->batch_items ||
> -				    rodata->batch[i + 1] != 0)
> -					return -EINVAL;
> +				    rodata->batch[i + 1] != 0) {
> +					ret = -EINVAL;
> +					goto err_out;
> +				}
>  
>  				d[i++] = s;
>  				s = upper_32_bits(r);
> @@ -120,6 +122,10 @@ static int render_state_setup(struct render_state *so)
>  	}
>  
>  	return 0;
> +
> +err_out:
> +	kunmap(page);
> +	return ret;
>  }
>  
>  void i915_gem_render_state_fini(struct render_state *so)
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list