From 520fe7c568ab5ff452ffd30831f2ae4949070a7b Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Wed, 24 Oct 2018 14:25:19 +0300 Subject: [PATCH] gpu: nvgpu: unit: free reg spaces in mockio test Get rid of some simple memory leaks: free the two allocated register spaces at the end of the register space test. Change-Id: Ib6341c34e8b6830073d43afc9291e1ea1da7184e Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1934472 Reviewed-by: svc-mobile-coverity Reviewed-by: Nicolas Benech GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: mobile promotions Tested-by: mobile promotions --- userspace/units/posix-mockio/posix-mockio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/userspace/units/posix-mockio/posix-mockio.c b/userspace/units/posix-mockio/posix-mockio.c index 032c3960b..b2d368c41 100644 --- a/userspace/units/posix-mockio/posix-mockio.c +++ b/userspace/units/posix-mockio/posix-mockio.c @@ -314,6 +314,10 @@ static int test_register_space(struct unit_module *m, struct gk20a *g, /* Calling this function again resets the recorder to use it again */ nvgpu_posix_io_start_recorder(g); + /* Free the reg space structures, too */ + nvgpu_posix_io_delete_reg_space(g, 0x10000000); + nvgpu_posix_io_delete_reg_space(g, 0x80000000); + /* Restore the old callbacks for other tests within this unit */ nvgpu_posix_register_io(g, old_cbs);