All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915: Fix memory leaks in i915 selftests
@ 2023-04-13  3:13 ` Cong Liu
  0 siblings, 0 replies; 21+ messages in thread
From: Cong Liu @ 2023-04-13  3:13 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Matthew Auld, Andi Shyti, Nirmoy Das,
	Andrzej Hajda, Matthew Brost, Jonathan Cavitt, Chris Wilson,
	Gwan-gyeong Mun, Mauro Carvalho Chehab, intel-gfx, dri-devel,
	linux-kernel
  Cc: Cong Liu

Fixes: c3bfba9a2225 ("drm/i915: Check for integer truncation on scatterlist creation")

Signed-off-by: Cong Liu <liucong2@kylinos.cn>
---
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index 5361ce70d3f2..154801f1c468 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -69,8 +69,10 @@ static int fake_get_pages(struct drm_i915_gem_object *obj)
 
 	rem = round_up(obj->base.size, BIT(31)) >> 31;
 	/* restricted by sg_alloc_table */
-	if (overflows_type(rem, unsigned int))
+	if (overflows_type(rem, unsigned int)) {
+		kfree(pages);
 		return -E2BIG;
+	}
 
 	if (sg_alloc_table(pages, rem, GFP)) {
 		kfree(pages);
-- 
2.34.1


No virus found
		Checked by Hillstone Network AntiVirus

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

end of thread, other threads:[~2023-04-22  3:38 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-13  3:13 [Intel-gfx] [PATCH] drm/i915: Fix memory leaks in i915 selftests Cong Liu
2023-04-13  3:13 ` Cong Liu
2023-04-13  6:10 ` [Intel-gfx] " Andrzej Hajda
2023-04-13  6:10   ` Andrzej Hajda
2023-04-13  7:15   ` [Intel-gfx] " Jani Nikula
2023-04-13  7:15     ` Jani Nikula
2023-04-13  7:55     ` [Intel-gfx] " Cong Liu
2023-04-13  7:55       ` Cong Liu
2023-04-13  7:55       ` Cong Liu
2023-04-13  8:44       ` [Intel-gfx] " Andi Shyti
2023-04-13  8:44         ` Andi Shyti
2023-04-13  8:44         ` Andi Shyti
2023-04-13  9:07         ` [Intel-gfx] " Cong Liu
2023-04-13  9:07           ` Cong Liu
2023-04-13  9:07           ` Cong Liu
2023-04-13  8:15 ` [Intel-gfx] " Andi Shyti
2023-04-13  8:15   ` Andi Shyti
2023-04-13  8:15   ` Andi Shyti
2023-04-21 18:05 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Fix memory leaks in i915 selftests (rev4) Patchwork
2023-04-21 18:18 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-04-22  3:38 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

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.