lkml.org 
[lkml]   [2018]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/1] drm/i915:Do not use kfree() to free kmem_cache_alloc() return value
Date
On Wed, 04 Apr 2018, Xidong Wang <wangxidong_97@163.com> wrote:
> In eb_lookup_vmas(), lut, the return value of kmem_cache_alloc(), is freed
> with kfree().I think the expected paired function is kmem_cache_free().

Agreed. But did you try to compile your patch before sending?

Fixes: d1b48c1e7184 ("drm/i915: Replace execbuf vma ht with an idr")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: <stable@vger.kernel.org> # v4.14+

BR,
Jani.

>
> Signed-off-by: Xidong Wang <wangxidong_97@163.com>
> ---
> drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 8c170db..08fe476 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -728,7 +728,7 @@ static int eb_lookup_vmas(struct i915_execbuffer *eb)
>
> err = radix_tree_insert(handles_vma, handle, vma);
> if (unlikely(err)) {
> - kfree(lut);
> + kmem_cache_free(lut);
> goto err_obj;
> }

--
Jani Nikula, Intel Open Source Technology Center

\
 
 \ /
  Last update: 2018-04-04 10:16    [W:0.162 / U:1.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site