]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/configfs: Free ctx_restore_mid_bb in release
authorShuicheng Lin <shuicheng.lin@intel.com>
Wed, 25 Feb 2026 01:34:49 +0000 (01:34 +0000)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Mon, 2 Mar 2026 16:12:34 +0000 (11:12 -0500)
ctx_restore_mid_bb memory is allocated in wa_bb_store(), but
xe_config_device_release() only frees ctx_restore_post_bb.

Free ctx_restore_mid_bb[0].cs as well to avoid leaking the allocation
when the configfs device is removed.

Fixes: b30d5de3d40c ("drm/xe/configfs: Add mid context restore bb")
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: Nitin Gote <nitin.r.gote@intel.com>
Link: https://patch.msgid.link/20260225013448.3547687-2-shuicheng.lin@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
(cherry picked from commit a235e7d0098337c3f2d1e8f3610c719a589e115f)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_configfs.c

index c59b1414df2235c310b42d0e1bf24d5a0174c52e..7fd07d1280bb1a20fbea133f191c42cea2c9e238 100644 (file)
@@ -830,6 +830,7 @@ static void xe_config_device_release(struct config_item *item)
 
        mutex_destroy(&dev->lock);
 
+       kfree(dev->config.ctx_restore_mid_bb[0].cs);
        kfree(dev->config.ctx_restore_post_bb[0].cs);
        kfree(dev);
 }