Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

device: fix mishandling of null device handle #31541

Closed
wants to merge 3 commits into from

Conversation

pabigot
Copy link
Collaborator

@pabigot pabigot commented Jan 22, 2021

The intent was always to have a zero valued device handle represent an unknown device. This was not reflected in the values used for handles, which were instead the zero-based ordinal of the device within the device table, making the first device indistinguishable from the null device.

Fix the generated dependency handles and the round-trip conversions between handle and device pointer.

Incidentally fixes the same issue as #31526, which this supersedes.

The intent was always to have a zero valued device handle represent an
unknown device.  This was not reflected in the values used for
handles, which were instead the zero-based ordinal of the device
within the device table, making the first device indistinguishable
from the null device.

Fix the generated dependency handles and the round-trip conversions
between handle and device pointer.

Signed-off-by: Peter Bigot <[email protected]>
A null device should map to a null device handle.

Signed-off-by: Peter Bigot <[email protected]>
A null device name should map to a null device.

Signed-off-by: Peter Bigot <[email protected]>
@pabigot pabigot marked this pull request as draft January 22, 2021 23:17
@pabigot
Copy link
Collaborator Author

pabigot commented Jan 22, 2021

Moved to draft as the device handle solution will be reverted by #31548.

@pabigot
Copy link
Collaborator Author

pabigot commented Jan 25, 2021

This will be incorporated into the PR that updates the device dependency infrastructure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: Kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants