* [PATCH] ttm: on move memory failure don't leave a node dangling
@ 2013-01-16 6:01 Dave Airlie
2013-01-16 16:02 ` Jerome Glisse
0 siblings, 1 reply; 2+ messages in thread
From: Dave Airlie @ 2013-01-16 6:01 UTC (permalink / raw)
To: dri-devel
if we have a move notify callback, when moving fails, we call move notify
the opposite way around, however this ends up with *mem containing the mm_node
from the bo, which means we double free it. This is a follow on to the previous
fix.
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/ttm/ttm_bo.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index cd64ead..076024e 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -434,6 +434,7 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
bo->mem = tmp_mem;
bdev->driver->move_notify(bo, mem);
bo->mem = *mem;
+ *mem = tmp_mem;
}
goto out_err;
--
1.8.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ttm: on move memory failure don't leave a node dangling
2013-01-16 6:01 [PATCH] ttm: on move memory failure don't leave a node dangling Dave Airlie
@ 2013-01-16 16:02 ` Jerome Glisse
0 siblings, 0 replies; 2+ messages in thread
From: Jerome Glisse @ 2013-01-16 16:02 UTC (permalink / raw)
To: Dave Airlie; +Cc: dri-devel
On Wed, Jan 16, 2013 at 1:01 AM, Dave Airlie <airlied@gmail.com> wrote:
> if we have a move notify callback, when moving fails, we call move notify
> the opposite way around, however this ends up with *mem containing the mm_node
> from the bo, which means we double free it. This is a follow on to the previous
> fix.
>
> Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
> ---
> drivers/gpu/drm/ttm/ttm_bo.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index cd64ead..076024e 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -434,6 +434,7 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
> bo->mem = tmp_mem;
> bdev->driver->move_notify(bo, mem);
> bo->mem = *mem;
> + *mem = tmp_mem;
> }
>
> goto out_err;
> --
> 1.8.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-16 16:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-16 6:01 [PATCH] ttm: on move memory failure don't leave a node dangling Dave Airlie
2013-01-16 16:02 ` Jerome Glisse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).