Skip to content

Commit 11572b3

Browse files
wangxiaoming321Thomas Hellström
authored andcommitted
drm/xe/display: Fix memleak in display initialization
intel_power_domains_init is called twice in xe_device_probe: 1) intel_power_domains_init() xe_display_init_nommio() xe_device_probe() 2) intel_power_domains_init() intel_display_driver_probe_noirq() xe_display_init_noirq() xe_device_probe() It needs remove one to avoid power_domains->power_wells double malloc. unreferenced object 0xffff88811150ee00 (size 512): comm "systemd-udevd", pid 506, jiffies 4294674198 (age 3605.560s) hex dump (first 32 bytes): 10 b4 9d a0 ff ff ff ff ff ff ff ff ff ff ff ff ................ ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 ................ backtrace: [<ffffffff8134b901>] __kmem_cache_alloc_node+0x1c1/0x2b0 [<ffffffff812c98b2>] __kmalloc+0x52/0x150 [<ffffffffa08b0033>] __set_power_wells+0xc3/0x360 [xe] [<ffffffffa08562fc>] xe_display_init_nommio+0x4c/0x70 [xe] [<ffffffffa07f0d1c>] xe_device_probe+0x3c/0x5a0 [xe] [<ffffffffa082e48f>] xe_pci_probe+0x33f/0x5a0 [xe] [<ffffffff817f2187>] local_pci_probe+0x47/0xa0 [<ffffffff817f3db3>] pci_device_probe+0xc3/0x1f0 [<ffffffff8192f2a2>] really_probe+0x1a2/0x410 [<ffffffff8192f598>] __driver_probe_device+0x78/0x160 [<ffffffff8192f6ae>] driver_probe_device+0x1e/0x90 [<ffffffff8192f92a>] __driver_attach+0xda/0x1d0 [<ffffffff8192c95c>] bus_for_each_dev+0x7c/0xd0 [<ffffffff8192e159>] bus_add_driver+0x119/0x220 [<ffffffff81930d00>] driver_register+0x60/0x120 [<ffffffffa05e50a0>] 0xffffffffa05e50a0 The call to intel_power_domains_cleanup() needs to stay where it is for now. The main issue is that while the init is called by the display side, shared by i915 and xe, the cleanup is called by a non-shared code path. Fixing that will be done as a separate commit. Fixes: 44e6949 ("drm/xe/display: Implement display support") Signed-off-by: Xiaoming Wang <[email protected]> [ reword commit message and explain why the fini needs to stay where it is ] Reviewed-by: Lucas De Marchi <[email protected]> Signed-off-by: Lucas De Marchi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 86c99ab) Signed-off-by: Thomas Hellström <[email protected]>
1 parent 3aa3c5c commit 11572b3

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

drivers/gpu/drm/xe/xe_display.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ static void xe_display_fini_nommio(struct drm_device *dev, void *dummy)
134134

135135
int xe_display_init_nommio(struct xe_device *xe)
136136
{
137-
int err;
138-
139137
if (!xe->info.enable_display)
140138
return 0;
141139

@@ -145,10 +143,6 @@ int xe_display_init_nommio(struct xe_device *xe)
145143
/* This must be called before any calls to HAS_PCH_* */
146144
intel_detect_pch(xe);
147145

148-
err = intel_power_domains_init(xe);
149-
if (err)
150-
return err;
151-
152146
return drmm_add_action_or_reset(&xe->drm, xe_display_fini_nommio, xe);
153147
}
154148

0 commit comments

Comments
 (0)