[Intel-gfx] [PATCH v3 1/2] drm/i915: avoid leaking DMA mappings
Chris Wilson
chris at chris-wilson.co.uk
Sat Jul 11 13:54:35 PDT 2015
On Thu, Jul 09, 2015 at 12:59:05PM +0300, Imre Deak wrote:
> +static int
> +__i915_gem_userptr_set_pages(struct drm_i915_gem_object *obj,
> + struct page **pvec, int num_pages)
> +{
> + int ret;
> +
> + ret = st_set_pages(&obj->pages, pvec, num_pages);
> + if (ret)
> + return ret;
> +
> + ret = i915_gem_gtt_prepare_object(obj);
> + if (ret) {
> + sg_free_table(obj->pages);
> + kfree(obj->pages);
> + obj->pages = NULL;
Oh dear, we just leaked a ref one each page.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list