Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/xe/reg_sr: Fix leak on xa_store failure

Free the newly allocated entry when xa_store() fails to avoid a memory
leak on the error path.

v2: use goto fail_free. (Bala)

Fixes: e5283bd4dfec ("drm/xe/reg_sr: Remove register pool")
Cc: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patch.msgid.link/20260204172810.1486719-2-shuicheng.lin@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>

authored by

Shuicheng Lin and committed by
Matt Roper
6bc6fec7 d139209e

+3 -1
+3 -1
drivers/gpu/drm/xe/xe_reg_sr.c
··· 100 100 *pentry = *e; 101 101 ret = xa_err(xa_store(&sr->xa, idx, pentry, GFP_KERNEL)); 102 102 if (ret) 103 - goto fail; 103 + goto fail_free; 104 104 105 105 return 0; 106 106 107 + fail_free: 108 + kfree(pentry); 107 109 fail: 108 110 xe_gt_err(gt, 109 111 "discarding save-restore reg %04lx (clear: %08x, set: %08x, masked: %s, mcr: %s): ret=%d\n",