diff options
| author | Dan Carpenter <[email protected]> | 2023-04-06 08:55:31 +0000 |
|---|---|---|
| committer | Joerg Roedel <[email protected]> | 2023-07-14 12:53:19 +0000 |
| commit | c20ecf7bb6153149b81a9277eda23398957656f2 (patch) | |
| tree | cd212870c5db9019fc8353020405111025d99553 /drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | |
| parent | iommu: Fix crash during syfs iommu_groups/N/type (diff) | |
| download | kernel-c20ecf7bb6153149b81a9277eda23398957656f2.tar.gz kernel-c20ecf7bb6153149b81a9277eda23398957656f2.zip | |
iommu/sva: Fix signedness bug in iommu_sva_alloc_pasid()
The ida_alloc_range() function returns negative error codes on error.
On success it returns values in the min to max range (inclusive). It
never returns more then INT_MAX even if "max" is higher. It never
returns values in the 0 to (min - 1) range.
The bug is that "min" is an unsigned int so negative error codes will
be promoted to high positive values errors treated as success.
Fixes: 1a14bf0fc7ed ("iommu/sva: Use GFP_KERNEL for pasid allocation")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Lu Baolu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Joerg Roedel <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c')
0 files changed, 0 insertions, 0 deletions
