drm: Branch 'master'

[email protected] (GitLab Mirror) Thu, 16 Aug 2018 06:53:52 +0000 (UTC)
Newsgroups gmane.comp.video.dri.patches
Message-ID <[email protected]>
 amdgpu/handle_table.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bc4c9f442246b8f39a6edf2673400cd97f3e1133
Author: Christian König <[email protected]>
Date:   Wed Aug 15 13:25:14 2018 +0200

    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 <[email protected]>
    Bugzilla: https://bugs.freedesktop.org/107552
    Reviewed-by: Michel Dänzer <[email protected]>
    Reviewed-by: Junwei Zhang <[email protected]>

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 *));

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--
_______________________________________________
Dri-patches mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-patches