Skip to content

Commit 578d6aa

Browse files
committed
Merge tag 'drm-xe-next-fixes-2025-11-21' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
Driver Changes: - A couple of SR-IOV fixes (Michal Winiarski) - Fix a potential UAF (Sanjay) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com> Link: https://patch.msgid.link/aSA08EW9JMU3LkIu@fedora
2 parents 611d4d1 + dcb1719 commit 578d6aa

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

drivers/gpu/drm/xe/xe_gt_sriov_pf_migration.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,10 @@ static int pf_save_vram_chunk(struct xe_gt *gt, unsigned int vfid,
571571
fence = __pf_save_restore_vram(gt, vfid,
572572
src_vram, src_vram_offset,
573573
data->bo, 0, size, true);
574+
if (IS_ERR(fence)) {
575+
ret = PTR_ERR(fence);
576+
goto fail;
577+
}
574578

575579
ret = dma_fence_wait_timeout(fence, false, PF_VRAM_SAVE_RESTORE_TIMEOUT);
576580
dma_fence_put(fence);
@@ -654,13 +658,20 @@ static int pf_restore_vf_vram_mig_data(struct xe_gt *gt, unsigned int vfid,
654658

655659
fence = __pf_save_restore_vram(gt, vfid, vram, data->hdr.offset,
656660
data->bo, 0, data->hdr.size, false);
661+
if (IS_ERR(fence)) {
662+
ret = PTR_ERR(fence);
663+
goto err;
664+
}
665+
657666
ret = dma_fence_wait_timeout(fence, false, PF_VRAM_SAVE_RESTORE_TIMEOUT);
658667
dma_fence_put(fence);
659668
if (!ret) {
660669
ret = -ETIME;
661670
goto err;
662671
}
663672

673+
xe_bo_put(vram);
674+
664675
return 0;
665676
err:
666677
xe_bo_put(vram);

drivers/gpu/drm/xe/xe_oa.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,11 +2403,13 @@ int xe_oa_add_config_ioctl(struct drm_device *dev, u64 data, struct drm_file *fi
24032403
goto sysfs_err;
24042404
}
24052405

2406-
mutex_unlock(&oa->metrics_lock);
2406+
id = oa_config->id;
2407+
2408+
drm_dbg(&oa->xe->drm, "Added config %s id=%i\n", oa_config->uuid, id);
24072409

2408-
drm_dbg(&oa->xe->drm, "Added config %s id=%i\n", oa_config->uuid, oa_config->id);
2410+
mutex_unlock(&oa->metrics_lock);
24092411

2410-
return oa_config->id;
2412+
return id;
24112413

24122414
sysfs_err:
24132415
mutex_unlock(&oa->metrics_lock);

drivers/gpu/drm/xe/xe_sriov_pf_migration.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,6 @@ pf_migration_consume(struct xe_device *xe, unsigned int vfid)
148148
* Return: Pointer to &xe_sriov_packet on success,
149149
* NULL if ring is empty and no more migration data is expected,
150150
* ERR_PTR value in case of error.
151-
*
152-
* Return: 0 on success or a negative error code on failure.
153151
*/
154152
struct xe_sriov_packet *
155153
xe_sriov_pf_migration_save_consume(struct xe_device *xe, unsigned int vfid)

0 commit comments

Comments
 (0)