Skip to content

Commit 0ddc917

Browse files
committed
Skip mdev release for an assignment with no device
An mdev assignment carrying neither a UUID nor a device path would resolve to DestroyMdev("."); release nothing instead.
1 parent 1631379 commit 0ddc917

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/devices/vgpu_linux.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ func DestroyVGPU(ctx context.Context, assignment VGPUAssignment) error {
9292
case VGPUFrameworkMdev:
9393
mdevUUID := assignment.MdevUUID
9494
if mdevUUID == "" {
95+
if assignment.DevicePath == "" {
96+
return nil
97+
}
9598
mdevUUID = filepath.Base(assignment.DevicePath)
9699
}
97100
return DestroyMdev(ctx, mdevUUID)

0 commit comments

Comments
 (0)