amdgpu: fix off by one in handle_table_insert
Stupid me, max_key must always be larger than key. Signed-off-by: Christian König <christian.koenig@amd.com> Bugzilla: https://bugs.freedesktop.org/107552 Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>main
parent
1e12c16d76
commit
bc4c9f4422
|
@ -33,7 +33,7 @@ drm_private int handle_table_insert(struct handle_table *table, uint32_t key,
|
|||
{
|
||||
if (key >= table->max_key) {
|
||||
uint32_t alignment = sysconf(_SC_PAGESIZE) / sizeof(void*);
|
||||
uint32_t max_key = ALIGN(key, alignment);
|
||||
uint32_t max_key = ALIGN(key + 1, alignment);
|
||||
void **values;
|
||||
|
||||
values = realloc(table->values, max_key * sizeof(void *));
|
||||
|
|
Loading…
Reference in New Issue