From patchwork Mon Dec 30 15:56:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 3419741 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 03FE7C02DC for ; Mon, 30 Dec 2013 15:57:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 66891200F3 for ; Mon, 30 Dec 2013 15:57:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4DA642010F for ; Mon, 30 Dec 2013 15:57:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A5A70FA83C; Mon, 30 Dec 2013 07:57:21 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qe0-f47.google.com (mail-qe0-f47.google.com [209.85.128.47]) by gabe.freedesktop.org (Postfix) with ESMTP id DE94DF9D8A for ; Mon, 30 Dec 2013 07:57:15 -0800 (PST) Received: by mail-qe0-f47.google.com with SMTP id t7so11368418qeb.6 for ; Mon, 30 Dec 2013 07:57:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GBEmaNGynTZkPIr6xaGQ7Pu03SxMwqybtf7G5e69HTE=; b=wZaPff7tRzDRgKvA9AymanqrS127/crmm+/572ikNS0FQR7BYgeDnHPjN91ix72vQd i4v3nZln1PG187PecHnaLfzmz+Z9SoJ3ol537xK4M6LNk/Ti/FVih3XiIAYOdLUJq06c +fmfi7MA5TDmLM331EmLYDOI/iWutNe4lquULZJjXkMDeLRJ4O+xl3NxAnQ2oKSeI3Kk mDgloVl+ajdJt4JklKnWlSObukYMeEe/3bWCA/Jy88xOv9lHaICetArLtusjF0minhBB Adl7RWslNXcqwe5luOnWxpZucCA2ylpNWIPgnXg7xjJAGHm81H2Rt4qx9FqZvAe8UbDQ uUcg== X-Received: by 10.229.179.69 with SMTP id bp5mr108406486qcb.17.1388419035452; Mon, 30 Dec 2013 07:57:15 -0800 (PST) Received: from localhost.localdomain ([187.112.58.219]) by mx.google.com with ESMTPSA id o3sm66129491qak.5.2013.12.30.07.57.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Dec 2013 07:57:15 -0800 (PST) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Mon, 30 Dec 2013 13:56:52 -0200 Message-Id: <1388419013-17016-5-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1388419013-17016-1-git-send-email-przanoni@gmail.com> References: <1388419013-17016-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 5/6] tests/kms_flip: don't leak the connector_config struct X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Paulo Zanoni ... in case we can't find a compatible mode. We already have config[0], we can't return without freeing it first. Caught by Valgrind. Signed-off-by: Paulo Zanoni --- tests/kms_flip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/kms_flip.c b/tests/kms_flip.c index 78e179e..c43a26f 100644 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -954,8 +954,10 @@ static void connector_find_compatible_mode(int crtc_idx0, int crtc_idx1, return; if (kmstest_get_connector_config(drm_fd, o->_connector[1], - 1 << crtc_idx1, &config[1]) < 0) + 1 << crtc_idx1, &config[1]) < 0) { + kmstest_free_connector_config(&config[0]); return; + } mode[0] = &config[0].default_mode; mode[1] = &config[1].default_mode;