Michel Thierry
0b37a9a9eb
drm/i915: Do not leak objects after capturing error state
While running kmemleak chasing a different memleak, I saw that the
capture_error_state function was leaking some objects, for example:
unreferenced object 0xffff8800a9b72148 (size 8192):
comm "kworker/u16:0", pid 1499, jiffies 4295201243 (age 990.096s)
hex dump (first 32 bytes):
00 00 04 00 00 00 00 00 5d f4 ff ff 00 00 00 00 ........].......
00 30 b0 01 00 00 00 00 37 00 00 00 00 00 00 00 .0......7.......
backtrace:
[<ffffffff811e5ae4>] create_object+0x104/0x2c0
[<ffffffff8178f50a>] kmemleak_alloc+0x7a/0xc0
[<ffffffff811cde4b>] __kmalloc+0xeb/0x220
[<ffffffffa038f1d9>] kcalloc.constprop.12+0x2d/0x2f [i915]
[<ffffffffa0316064>] i915_capture_error_state+0x3f4/0x1660 [i915]
[<ffffffffa03207df>] i915_handle_error+0x7f/0x660 [i915]
[<ffffffffa03210f7>] i915_hangcheck_elapsed+0x2e7/0x470 [i915]
[<ffffffff8108d574>] process_one_work+0x144/0x490
[<ffffffff8108dfbd>] worker_thread+0x11d/0x530
[<ffffffff81094079>] kthread+0xc9/0xe0
[<ffffffff817a2398>] ret_from_fork+0x58/0x90
[<ffffffffffffffff>] 0xffffffffffffffff
The following objects are allocated in i915_gem_capture_buffers, but not
released in i915_error_state_free:
- error->active_bo_count
- error->pinned_bo
- error->pinned_bo_count
- error->active_bo[vm_count] (allocated in i915_gem_capture_vm).
The leaks were introduced by
commit 95f5301dd8
Author: Ben Widawsky <ben@bwidawsk.net>
Date: Wed Jul 31 17:00:15 2013 -0700
drm/i915: Update error capture for VMs
v2: Reuse iterator and add culprit commit details (Chris)
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-03-20 15:46:46 +01:00
..
2015-03-10 00:28:43 +01:00
2015-02-10 10:23:15 +00:00
2015-03-01 18:43:51 -08:00
2015-03-02 12:08:43 -05:00
2015-03-06 01:29:31 +01:00
2015-01-29 10:54:43 +02:00
2015-02-28 10:21:57 -08:00
2015-02-23 09:30:35 +02:00
2015-02-17 09:27:54 -08:00
2015-03-06 22:35:49 +01:00
2015-03-15 15:07:08 -07:00
2015-02-25 10:28:55 +01:00
2015-02-04 10:42:55 -08:00
2015-03-06 13:43:33 -08:00
2015-03-05 23:13:19 +01:00
2015-02-18 08:49:20 -08:00
2015-02-13 21:39:06 +01:00
2015-03-05 22:15:35 +05:30
2015-02-19 11:18:14 -08:00
2015-02-02 21:56:03 +01:00
2015-03-02 14:18:57 +01:00
2015-02-23 15:40:32 +01:00
2015-03-20 15:46:46 +01:00
2015-02-23 15:28:40 +01:00
2015-02-15 10:48:44 -08:00
2015-02-22 20:10:30 -08:00
2015-03-12 10:23:05 +01:00
2015-02-15 19:40:09 +01:00
2015-02-28 07:19:27 -08:00
2015-02-22 17:42:14 -08:00
2015-03-09 18:06:13 -07:00
2015-03-03 14:04:12 +01:00
2015-03-15 01:41:26 +00:00
2015-03-03 15:30:07 -08:00
2015-02-02 14:36:10 -08:00
2015-02-18 09:24:01 -08:00
2015-02-11 12:56:40 -08:00
2015-02-03 15:48:51 -08:00
2015-02-25 11:38:46 +11:00
2015-02-11 17:06:05 -08:00
2015-01-29 22:57:43 -06:00
2015-02-03 15:58:39 -08:00
2015-02-18 09:05:48 -08:00
2015-03-01 19:34:50 -08:00
2015-02-21 12:30:30 -08:00
2015-03-02 22:55:56 -08:00
2015-03-09 15:53:42 -04:00
2015-02-04 09:15:18 +01:00
2015-03-10 10:44:21 -05:00
2015-03-12 09:45:46 -07:00
2015-02-17 09:38:59 -08:00
2015-02-15 10:24:55 -08:00
2015-02-11 11:23:13 -08:00
2015-02-21 11:12:07 -08:00
2015-02-21 04:29:16 +01:00
2015-01-28 15:08:10 +01:00
2015-02-18 08:40:29 +01:00
2015-02-18 08:49:20 -08:00
2015-03-06 21:10:30 +00:00
2015-03-12 18:46:07 -07:00
2015-02-26 09:24:48 +01:00
2015-03-06 20:51:29 -08:00
2015-02-24 07:26:12 +09:00
2015-02-17 09:38:59 -08:00
2015-03-06 21:10:56 +00:00
2015-02-11 14:38:29 -08:00
2015-03-01 19:25:59 -08:00
2015-02-21 13:21:19 -08:00
2015-03-05 01:47:57 -04:00
2015-03-08 12:25:40 -07:00
2015-03-13 10:55:32 -07:00
2015-02-15 10:24:55 -08:00
2015-03-12 09:51:38 -06:00
2015-03-03 15:30:07 -08:00
2015-02-26 10:23:15 +02:00
2015-02-17 16:19:29 +10:30
2015-03-06 00:46:31 +01:00
2015-03-11 14:34:40 +00:00
2015-02-03 15:58:39 -08:00