Yongxin Liu
b92f12c5ee
drm/nouveau: fix memory leak in nouveau_conn_reset()
[ Upstream commit 09b90e2fe3 ]
In nouveau_conn_reset(), if connector->state is true,
__drm_atomic_helper_connector_destroy_state() will be called,
but the memory pointed by asyc isn't freed. Memory leak happens
in the following function __drm_atomic_helper_connector_reset(),
where newly allocated asyc->state will be assigned to connector->state.
So using nouveau_conn_atomic_destroy_state() instead of
__drm_atomic_helper_connector_destroy_state to free the "old" asyc.
Here the is the log showing memory leak.
unreferenced object 0xffff8c5480483c80 (size 192):
comm "kworker/0:2", pid 188, jiffies 4294695279 (age 53.179s)
hex dump (first 32 bytes):
00 f0 ba 7b 54 8c ff ff 00 00 00 00 00 00 00 00 ...{T...........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<000000005005c0d0>] kmem_cache_alloc_trace+0x195/0x2c0
[<00000000a122baed>] nouveau_conn_reset+0x25/0xc0 [nouveau]
[<000000004fd189a2>] nouveau_connector_create+0x3a7/0x610 [nouveau]
[<00000000c73343a8>] nv50_display_create+0x343/0x980 [nouveau]
[<000000002e2b03c3>] nouveau_display_create+0x51f/0x660 [nouveau]
[<00000000c924699b>] nouveau_drm_device_init+0x182/0x7f0 [nouveau]
[<00000000cc029436>] nouveau_drm_probe+0x20c/0x2c0 [nouveau]
[<000000007e961c3e>] local_pci_probe+0x47/0xa0
[<00000000da14d569>] work_for_cpu_fn+0x1a/0x30
[<0000000028da4805>] process_one_work+0x27c/0x660
[<000000001d415b04>] worker_thread+0x22b/0x3f0
[<0000000003b69f1f>] kthread+0x12f/0x150
[<00000000c94c29b7>] ret_from_fork+0x3a/0x50
Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-08-06 19:05:25 +02:00
..
2019-07-10 09:54:40 +02:00
2019-06-25 11:36:53 +08:00
2019-07-31 07:28:50 +02:00
2019-06-11 12:21:49 +02:00
2019-07-10 09:54:38 +02:00
2019-07-10 09:54:40 +02:00
2019-07-10 09:54:32 +02:00
2019-05-04 09:15:21 +02:00
2019-07-31 07:28:52 +02:00
2019-08-06 19:05:25 +02:00
2019-07-31 07:28:49 +02:00
2019-06-11 12:21:50 +02:00
2019-07-31 07:28:51 +02:00
2019-05-16 19:42:24 +02:00
2019-07-21 09:04:43 +02:00
2019-05-02 09:40:30 +02:00
2019-04-03 06:25:19 +02:00
2019-07-31 07:28:51 +02:00
2019-06-19 08:20:58 +02:00
2019-06-15 11:55:00 +02:00
2019-07-21 09:04:27 +02:00
2019-07-31 07:28:56 +02:00
2019-04-05 22:31:40 +02:00
2019-05-31 06:47:35 -07:00
2019-07-31 07:28:49 +02:00
2019-05-31 06:47:35 -07:00
2019-07-21 09:04:27 +02:00
2019-03-27 14:13:54 +09:00
2019-02-15 08:09:12 +01:00
2019-04-05 22:31:39 +02:00