mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 01:38:06 +02:00
anv: avoid potential integer overflow
Coverity points out that we're using a 32bit type on the left side here, so the entire operation is done as 32 bit instead of 64 CID: 1646960 Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35114>
This commit is contained in:
parent
2a3cf70db8
commit
ff5cb90880
1 changed files with 1 additions and 1 deletions
|
|
@ -134,7 +134,7 @@ anv_slab_bo_alloc(struct anv_device *device, const char *name, uint64_t requeste
|
|||
|
||||
const unsigned num_slab_allocator = ARRAY_SIZE(device->bo_slabs);
|
||||
struct pb_slabs *last_slab = &device->bo_slabs[num_slab_allocator - 1];
|
||||
const uint64_t max_slab_entry_size = 1 << (last_slab->min_order + last_slab->num_orders - 1);
|
||||
const uint64_t max_slab_entry_size = BITFIELD64_BIT(last_slab->min_order + last_slab->num_orders - 1);
|
||||
|
||||
if (requested_size > max_slab_entry_size)
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue