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/sysfs: Add cleanup action in xe_device_sysfs_init

On partial failure, some sysfs files created before the failure might
not be removed. Add common cleanup step to remove them all immediately,
as is should be harmless to attempt to remove non-existing files.

Fixes: 0e414bf7ad01 ("drm/xe: Expose PCIe link downgrade attributes")
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Stuart Summers <stuart.summers@intel.com>
Cc: Shuicheng Lin <shuicheng.lin@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Zongyao Bai <zongyao.bai@intel.com>
Reviewed-by: Shuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20250915214716.1327379-2-zongyao.bai@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

authored by

Zongyao Bai and committed by
Lucas De Marchi
1a869168 456b32c9

+6 -2
+6 -2
drivers/gpu/drm/xe/xe_device_sysfs.c
··· 311 311 if (xe->info.platform == XE_BATTLEMAGE) { 312 312 ret = sysfs_create_files(&dev->kobj, auto_link_downgrade_attrs); 313 313 if (ret) 314 - return ret; 314 + goto cleanup; 315 315 316 316 ret = late_bind_create_files(dev); 317 317 if (ret) 318 - return ret; 318 + goto cleanup; 319 319 } 320 320 321 321 return devm_add_action_or_reset(dev, xe_device_sysfs_fini, xe); 322 + 323 + cleanup: 324 + xe_device_sysfs_fini(xe); 325 + return ret; 322 326 }