Skip to content

Commit f38c4d2

Browse files
hghimiralucasdemarchi
authored andcommitted
drm/xe: call free_gsc_pkt only once on action add failure
The drmm_add_action_or_reset function automatically invokes the action (free_gsc_pkt) in the event of a failure; therefore, there's no necessity to call it within the return check. -v2 Fix commit message. (Lucas) Fixes: d8b1571 ("drm/xe/huc: HuC authentication via GSC") Cc: Rodrigo Vivi <[email protected]> Cc: Daniele Ceraolo Spurio <[email protected]> Reviewed-by: Lucas De Marchi <[email protected]> Reviewed-by: Daniele Ceraolo Spurio <[email protected]> Signed-off-by: Himal Prasad Ghimiray <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Lucas De Marchi <[email protected]> (cherry picked from commit 22bf0bc) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent d6dab90 commit f38c4d2

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

drivers/gpu/drm/xe/xe_huc.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ static int huc_alloc_gsc_pkt(struct xe_huc *huc)
5353
struct xe_gt *gt = huc_to_gt(huc);
5454
struct xe_device *xe = gt_to_xe(gt);
5555
struct xe_bo *bo;
56-
int err;
5756

5857
/* we use a single object for both input and output */
5958
bo = xe_bo_create_pin_map(xe, gt_to_tile(gt), NULL,
@@ -66,13 +65,7 @@ static int huc_alloc_gsc_pkt(struct xe_huc *huc)
6665

6766
huc->gsc_pkt = bo;
6867

69-
err = drmm_add_action_or_reset(&xe->drm, free_gsc_pkt, huc);
70-
if (err) {
71-
free_gsc_pkt(&xe->drm, huc);
72-
return err;
73-
}
74-
75-
return 0;
68+
return drmm_add_action_or_reset(&xe->drm, free_gsc_pkt, huc);
7669
}
7770

7871
int xe_huc_init(struct xe_huc *huc)

0 commit comments

Comments
 (0)