From patchwork Fri Jun 26 10:22:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Morton X-Patchwork-Id: 6680161 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8F15C9F39B for ; Fri, 26 Jun 2015 10:22:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4B6E206A1 for ; Fri, 26 Jun 2015 10:22:42 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EEA532069D for ; Fri, 26 Jun 2015 10:22:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 48AA86ED96; Fri, 26 Jun 2015 03:22:41 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id BBAEA6ED96 for ; Fri, 26 Jun 2015 03:22:39 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 26 Jun 2015 03:22:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,683,1427785200"; d="scan'208";a="735114249" Received: from djmorton-linux.isw.intel.com ([10.102.226.153]) by fmsmga001.fm.intel.com with ESMTP; 26 Jun 2015 03:22:40 -0700 From: Derek Morton To: intel-gfx@lists.freedesktop.org Date: Fri, 26 Jun 2015 11:22:30 +0100 Message-Id: <1435314150-12662-1-git-send-email-derek.j.morton@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [Intel-gfx] [PATCH i-g-t] tests/gem_fenced_exec_thrash.c: Fix memory leaks X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP gem_fenced_exec_thrash was not freeing any resources between subtests. On 1Gb android systems this resulted in the test failing with an OOM error. Added cleanup code to free BOs at the end of each subtest. Signed-off-by: Derek Morton --- tests/gem_fenced_exec_thrash.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/gem_fenced_exec_thrash.c b/tests/gem_fenced_exec_thrash.c index 75f251c..c0e820f 100644 --- a/tests/gem_fenced_exec_thrash.c +++ b/tests/gem_fenced_exec_thrash.c @@ -215,6 +215,18 @@ static void run_test(int fd, int num_fences, int expected_errno, if (flags & INTERRUPTIBLE) igt_stop_signal_helper(); + + /* Cleanup */ + for (n = 0; n < 2*num_fences; n++) + gem_close(fd, exec[0][n].handle); + + for (i = 0; i < 2; i++) + gem_close(fd, exec[i][2*num_fences].handle); + + if (flags & BUSY_LOAD) { + intel_batchbuffer_free(batch); + drm_intel_bufmgr_destroy(bufmgr); + } } int fd;