nouveau: free the memory in nouveau_gart_manager_del()
Subsystems (4)
PATCH 1/1 nouveau: free the memory in nouveau_gart_manager_del()
In the original code the kfree() doesn't do anything because "mem->mm_node" has been set to NULL. This was introduced in d2f96666c56a "drm/nouveau: create temp vmas for both src and dst of bo moves"
drivers/gpu/drm/nouveau/nouveau_mem.c +1 -1
@@ -846,8 +846,8 @@ nouveau_gart_manager_del(struct ttm_mem_type_manager *man, struct ttm_mem_reg *mem) {nouveau_mem_node_cleanup (mem->mm_node); - mem->mm_node =NULL ;kfree (mem->mm_node); + mem->mm_node =NULL ; } static int
Quoted 4 lines · Dan Carpenter
In the original code the
kfree()doesn't do anything because "mem->mm_node" has been set to NULL. This was introduced ind2f96666c56a"drm/nouveau: create temp vmas for both src and dst of bo moves"
Already fixed in nouveau git, I'll get the fixes to Dave.
Ben.
Quoted 17 lines
Signed-off-by Dan Carpenter <[email protected]>drivers/gpu/drm/nouveau/nouveau_mem.c +1
-1@@ -846,8 +846,8 @@ nouveau_gart_manager_del(struct ttm_mem_type_manager *man, struct ttm_mem_reg *mem) {nouveau_mem_node_cleanup (mem->mm_node); - mem->mm_node =NULL ;kfree (mem->mm_node); + mem->mm_node =NULL ; } static int
great bug to make sure that mem is never freed :)
@julia,
can coccinelle find this type ?
they will never cause an error just a memleack that never will be notices before its to late.
re,
wh
Am 25.06.2011 07:53, schrieb Dan Carpenter:
Quoted 27 lines
In the original code the
kfree()doesn't do anything because "mem->mm_node" has been set to NULL. This was introduced ind2f96666c56a"drm/nouveau: create temp vmas for both src and dst of bo moves"Signed-off-by Dan Carpenter <[email protected]>drivers/gpu/drm/nouveau/nouveau_mem.c +1
-2@@ -846,8 +846,8 @@ nouveau_gart_manager_del(struct ttm_mem_type_manager *man, struct ttm_mem_reg *mem) {nouveau_mem_node_cleanup (mem->mm_node); - mem->mm_node =NULL ;kfree (mem->mm_node); + mem->mm_node =NULL ; } static int --To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines · walter harms
great bug to make sure that mem is never freed :)
@julia,
can coccinelle find this type ?
Yes, I looked and didn't find any other than this one.
julia
Quoted 40 lines
they will never cause an error just a memleack that never will be notices before its to late.
re,
whAm 25.06.2011 07:53, schrieb Dan Carpenter:
Quoted 22 lines
In the original code the
kfree()doesn't do anything because "mem->mm_node" has been set to NULL. This was introduced ind2f96666c56a"drm/nouveau: create temp vmas for both src and dst of bo moves"Signed-off-by Dan Carpenter <[email protected]>drivers/gpu/drm/nouveau/nouveau_mem.c +1
-2@@ -846,8 +846,8 @@ nouveau_gart_manager_del(struct ttm_mem_type_manager *man, struct ttm_mem_reg *mem) {nouveau_mem_node_cleanup (mem->mm_node); - mem->mm_node =NULL ;kfree (mem->mm_node); + mem->mm_node =NULL ; } static int --Quoted 5 lines
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 10 lines · Julia Lawall
Quoted 5 lines · walter harms
great bug to make sure that mem is never freed :)
@julia,
can coccinelle find this type ?
Yes, I looked and didn't find any other than this one.
I've found a hand full of these in the past, but I've fixed them all. :P
regards,
dan carpenter