[PATCH] drm/xe/tile: Release kobject for the failure path
Matthew Brost
matthew.brost at intel.com
Tue Aug 19 04:22:46 UTC 2025
On Tue, Aug 19, 2025 at 12:39:58AM +0000, Shuicheng Lin wrote:
> Call kobject_put() for the failure path to release the kobject
>
> Fixes: e3d0839aa501 ("drm/xe/tile: Abort driver load for sysfs creation failure")
> Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>
> Signed-off-by: Shuicheng Lin <shuicheng.lin at intel.com>
> ---
> drivers/gpu/drm/xe/xe_tile_sysfs.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_tile_sysfs.c b/drivers/gpu/drm/xe/xe_tile_sysfs.c
> index b804234a6551..99dbf232535a 100644
> --- a/drivers/gpu/drm/xe/xe_tile_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_tile_sysfs.c
> @@ -44,16 +44,19 @@ int xe_tile_sysfs_init(struct xe_tile *tile)
> kt->tile = tile;
>
> err = kobject_add(&kt->base, &dev->kobj, "tile%d", tile->id);
> - if (err) {
> - kobject_put(&kt->base);
> - return err;
> - }
> + if (err)
> + goto err_object;
>
> tile->sysfs = &kt->base;
>
> err = xe_vram_freq_sysfs_init(tile);
> if (err)
> - return err;
> + goto err_object;
> +
Extra newline.
Otherwise LGTM, with the newline fix:
Reviewed-by: Matthew Brost <matthew.brost at intel.com>
>
> return devm_add_action_or_reset(xe->drm.dev, tile_sysfs_fini, tile);
> +
> +err_object:
> + kobject_put(&kt->base);
> + return err;
> }
> --
> 2.49.0
>
More information about the Intel-xe
mailing list