mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-08 15:04:45 +00:00
drm/xe: use devm_add_action_or_reset() helper
Use devm_add_action_or_reset() to release resources in case of failure, because the cleanup function will be automatically called. Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: He Lugang <helugang@uniontech.com> Link: https://patchwork.freedesktop.org/patch/msgid/9631BC17D1E028A2+20240911102215.84865-1-helugang@uniontech.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
parent
20e3aa503f
commit
fdc81c43f0
@ -237,11 +237,11 @@ int xe_gt_freq_init(struct xe_gt *gt)
|
||||
if (!gt->freq)
|
||||
return -ENOMEM;
|
||||
|
||||
err = devm_add_action(xe->drm.dev, freq_fini, gt->freq);
|
||||
err = sysfs_create_files(gt->freq, freq_attrs);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = sysfs_create_files(gt->freq, freq_attrs);
|
||||
err = devm_add_action_or_reset(xe->drm.dev, freq_fini, gt->freq);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
@ -51,5 +51,5 @@ int xe_gt_sysfs_init(struct xe_gt *gt)
|
||||
|
||||
gt->sysfs = &kg->base;
|
||||
|
||||
return devm_add_action(xe->drm.dev, gt_sysfs_fini, gt);
|
||||
return devm_add_action_or_reset(xe->drm.dev, gt_sysfs_fini, gt);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user