Dan Carpenter c20ecf7bb6 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 <error27@gmail.com>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/6b32095d-7491-4ebb-a850-12e96209eaaf@kili.mountain
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2023-07-14 14:53:19 +02:00
..
2023-06-29 20:51:03 -07:00
2023-06-29 20:51:03 -07:00
2023-06-29 20:57:27 -07:00
2023-06-29 20:51:03 -07:00
2022-09-09 09:26:22 +02:00
2022-11-03 15:47:54 +01:00
2023-03-31 10:03:31 +02:00
2023-02-24 14:34:12 -08:00
2023-02-24 13:40:13 -08:00