diff options
| author | Shuicheng Lin <[email protected]> | 2025-11-10 18:45:23 +0000 |
|---|---|---|
| committer | Lucas De Marchi <[email protected]> | 2025-11-25 19:53:23 +0000 |
| commit | 76555b1eb278da420b6e4d26714319a7a4460e7b (patch) | |
| tree | c14de80ea46720befa73e384313942dee0f1d989 /lib/test_fortify/write_overflow-strlcpy-src.c | |
| parent | Linux 6.18-rc7 (diff) | |
| download | kernel-76555b1eb278da420b6e4d26714319a7a4460e7b.tar.gz kernel-76555b1eb278da420b6e4d26714319a7a4460e7b.zip | |
drm/xe/guc: Fix resource leak in xe_guc_ct_init_noalloc()
xe_guc_ct_init_noalloc() allocates the CT workqueue and other helpers
before it tries to initialize ct->lock. If drmm_mutex_init() fails
we currently bail out without releasing those resources because the
guc_ct_fini() hasn’t been registered yet.
Since destroy_workqueue() in guc_ct_fini() may flush the workqueue, which
in turn can take the ct lock, the initialization sequence is restructured
to first initialize the ct->lock, then set up all CT state, and finally
register guc_ct_fini().
v2: guc_ct_fini() does take ct lock. (Matt)
v3: move primelockdep() together with drmm_mutex_init(). (Lucas)
Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Cc: Lucas De Marchi <[email protected]>
Cc: Matthew Brost <[email protected]>
Signed-off-by: Shuicheng Lin <[email protected]>
Reviewed-by: Lucas De Marchi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Lucas De Marchi <[email protected]>
(cherry picked from commit 2e4ad5b0667244f496783c58de0995b9562d3344)
Signed-off-by: Lucas De Marchi <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strlcpy-src.c')
0 files changed, 0 insertions, 0 deletions
