All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] drm/i915: Do not use kfree() to free kmem_cache_alloc() return value
@ 2018-04-04  7:37 Xidong Wang
  2018-04-04  7:56   ` Chris Wilson
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Xidong Wang @ 2018-04-04  7:37 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, David Airlie
  Cc: intel-gfx, dri-devel, linux-kernel, Xidong Wang

In eb_lookup_vmas(), the return value of kmem_cache_alloc() is freed
with kfree(). I think the expected paired function is kmem_cahce_free().

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..0414228 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(eb->i915->luts, lut);
 			goto err_obj;
 		}
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread
* [PATCH 1/1] drm/i915:Do not use kfree() to free kmem_cache_alloc() return value
@ 2018-04-04  6:37 Xidong Wang
  2018-04-04  8:16   ` Jani Nikula
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Xidong Wang @ 2018-04-04  6:37 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, David Airlie
  Cc: intel-gfx, dri-devel, linux-kernel, Xidong Wang

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().

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;
 		}
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2018-04-04 20:54 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-04  7:37 [PATCH 1/1] drm/i915: Do not use kfree() to free kmem_cache_alloc() return value Xidong Wang
2018-04-04  7:56 ` Chris Wilson
2018-04-04  7:56   ` Chris Wilson
2018-04-04  9:38 ` [RESEND] drm/i915: Do no use kfree() to free a " Chris Wilson
2018-04-04 10:32 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-04-04 11:51 ` ✓ Fi.CI.IGT: " Patchwork
2018-04-04 20:54 ` [PATCH 1/1] drm/i915: Do not use kfree() to free " Chris Wilson
2018-04-04 20:54   ` Chris Wilson
  -- strict thread matches above, loose matches on Subject: below --
2018-04-04  6:37 [PATCH 1/1] drm/i915:Do " Xidong Wang
2018-04-04  8:16 ` Jani Nikula
2018-04-04  8:16   ` Jani Nikula
2018-04-04 13:02 ` kbuild test robot
2018-04-04 13:02   ` kbuild test robot
2018-04-04 13:24 ` kbuild test robot
2018-04-04 13:24   ` kbuild test robot
2018-04-04 13:44 ` kbuild test robot
2018-04-04 13:44   ` kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.