Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/ttm Fix error branch in ttm_d...



details:   https://anonhg.NetBSD.org/src/rev/e3f6c024443a
branches:  trunk
changeset: 825782:e3f6c024443a
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Jul 30 13:43:48 2017 +0000

description:
Fix error branch in ttm_dma_tt_init to avoid double-free.

Should fix symptom of PR kern/52438, but who knows what underlying
problem causes us to reach the error branch in the first place.

diffstat:

 sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r fd79417a5d56 -r e3f6c024443a sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c
--- a/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c       Sun Jul 30 13:12:49 2017 +0000
+++ b/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c       Sun Jul 30 13:43:48 2017 +0000
@@ -284,7 +284,8 @@
 fail1: kmem_free(ttm_dma->dma_segs, (ttm->num_pages *
                sizeof(ttm_dma->dma_segs[0])));
 fail0: KASSERT(error);
-       ttm_tt_destroy(ttm);
+       drm_free_large(ttm->pages);
+       uao_detach(ttm->swap_storage);
        /* XXX errno NetBSD->Linux */
        return -error;
     }



Home | Main Index | Thread Index | Old Index