Re: [PATCH v3 1/2] drm/i915: avoid leaking DMA mappings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]