Skip to content

Guard Free against invalid devices#69

Open
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix-free-invalid-devices
Open

Guard Free against invalid devices#69
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix-free-invalid-devices

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

  • only return devices to the allocator when they are currently allocated by that allocator
  • ignore nil, unknown, unallocated, or fabricated devices instead of adding them to the available set
  • add focused tests for normal frees and invalid device inputs

Why

Free previously inserted every provided device into remaining before deleting it from allocated. That allowed a foreign or constructed Device to become available for future allocations.

Testing

  • go test ./...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant