]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe/nvm: Defer xe->nvm assignment until init succeeds
authorShuicheng Lin <shuicheng.lin@intel.com>
Tue, 20 Jan 2026 18:32:43 +0000 (18:32 +0000)
committerAshutosh Dixit <ashutosh.dixit@intel.com>
Thu, 29 Jan 2026 02:40:08 +0000 (18:40 -0800)
commit7755ed58a49f4c7f603e2b7b9fd5073a70d96406
tree0c4ecc4932dd6f9b3ba66e78259575d141bb8a9e
parenta3187c0c2bbd947ffff97f90d077ac88f9c2a215
drm/xe/nvm: Defer xe->nvm assignment until init succeeds

Allocate and initialize the NVM structure using a local pointer and
assign it to xe->nvm only after all initialization steps succeed.

This avoids exposing a partially initialized xe->nvm and removes the
need to explicitly clear xe->nvm on error paths, simplifying error
handling and making the lifetime rules clearer.

Cc: Alexander Usyskin <alexander.usyskin@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Brian Nguyen <brian3.nguyen@intel.com>
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: Brian Nguyen <brian3.nguyen@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Link: https://patch.msgid.link/20260120183239.2966782-8-shuicheng.lin@intel.com
drivers/gpu/drm/xe/xe_nvm.c