On 2018-08-15 01:25 PM, Christian König wrote:
> Stupid me, max_key must always be larger than key.
> 
> Signed-off-by: Christian König <christian.koe...@amd.com>
> ---
>  amdgpu/handle_table.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/amdgpu/handle_table.c b/amdgpu/handle_table.c
> index 15cd4763..4fdd29d3 100644
> --- a/amdgpu/handle_table.c
> +++ b/amdgpu/handle_table.c
> @@ -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 *));
> 

Good catch! Looks like you can add

Bugzilla: https://bugs.freedesktop.org/107552

as well as

Reviewed-by: Michel Dänzer <michel.daen...@amd.com>

before pushing.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to