Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp646023pxb; Tue, 2 Feb 2021 14:14:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxmQKFa9pz3KNSCzmeVXiJSffLqNkH+lJWaBuw93QbHBuBeqm3x5Fiu0ZB4fgjobL8vECrM X-Received: by 2002:a17:906:384c:: with SMTP id w12mr152523ejc.140.1612304055073; Tue, 02 Feb 2021 14:14:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612304055; cv=none; d=google.com; s=arc-20160816; b=sMVB8e2S+hnukR6tMUQxXa7yweUbuVpKT6SCueSmiER1v7Ywzm6Z6nhD7TB8tNYZVr 1Lz/V6MhHOCbwSdSJ6Nz+/D8OPGCrUj+BuXWthypyUNpxPw0EoYdQbZypdS2osbUHFSc 4NxBMAUye6nVnetqvFYdmXJuSdUBL7zzsSz1jcobwMDtDaP3uLIOCe5OQbqrin1+6KcB Wdx7X2f0rnkS0ztBdNgepU/ZqH+ufVF9Xf1fmDVGy1ztsLgwv9soikSynWXK/jM10I40 gu9cOBy21EhPBfRz7AxpLe44y1bJi1yqFHoMocdMMM7/xKe+OIRKUrwub197gZc+5HL4 SHSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dNUxbxzSvbvgNReQacLUabhwI9n2LQJIWlW9At3y1gE=; b=X4U1pPXq2gNW3oRmB5tWH10DK4aorVGNfxsYN7ofp22eYInMid9mShajwSpzCn5iaw yMUjU5tl2JH1DyyfGPYqtIs64WAFkA7U2I3DuZP1F/91qJXWxHGlBVAKEMN3TxKIYorj REFqk5eRjcZ84hm213BTpIyzLfo0i01z5SLSqiJzUoph4YnN6pPyJtj0IrgwoJaxlcs7 0pTGuXeceaYFyUX7cxdaxobPubO7siwqL6pOc7WFqpocXvTqL3JJcwygC8yleOe5uscw SSVg7ZVv0vD/ibisqaATbgpmSFhR8/nwnONVQD2rnVXyL/tPdzxXMC3tN52CQuqRiL9V PJog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZNEYONwC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w24si52225eds.15.2021.02.02.14.13.44; Tue, 02 Feb 2021 14:14:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZNEYONwC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233135AbhBBNy4 (ORCPT + 99 others); Tue, 2 Feb 2021 08:54:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:38228 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232982AbhBBNr4 (ORCPT ); Tue, 2 Feb 2021 08:47:56 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id DE41864F9B; Tue, 2 Feb 2021 13:42:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612273325; bh=1wX7qwo1dJqDUD841LziCf3Dw4cpG93Vp6uL2G3iM+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZNEYONwC7eUOM0fuCcAe5eVgUXWDB+gMx0+NKGhQCAZGPj33U4LiGHuqgIInlwXS/ GJaEhwILwjDVEgZoXBPx/7ZoYT2Jd6Lo/9ljIUJfiIqwNXTxuqRwmxTstwa6BThZmd 6kAMTH90m2E0olE7ZJt0BmDLD9CoTQtnfGJ2NPw0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pan Bian , Chris Wilson , Jani Nikula Subject: [PATCH 5.10 064/142] drm/i915/selftest: Fix potential memory leak Date: Tue, 2 Feb 2021 14:37:07 +0100 Message-Id: <20210202133000.362156066@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210202132957.692094111@linuxfoundation.org> References: <20210202132957.692094111@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pan Bian commit 3d480fe1befa0ef434f5c25199e7d45c26870555 upstream. Object out is not released on path that no VMA instance found. The root cause is jumping to an unexpected label on the error path. Fixes: a47e788c2310 ("drm/i915/selftests: Exercise CS TLB invalidation") Signed-off-by: Pan Bian Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20210122015640.16002-1-bianpan2016@163.com (cherry picked from commit 2b015017d5cb01477a79ca184ac25c247d664568) Signed-off-by: Jani Nikula Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c @@ -1880,7 +1880,7 @@ static int igt_cs_tlb(void *arg) vma = i915_vma_instance(out, vm, NULL); if (IS_ERR(vma)) { err = PTR_ERR(vma); - goto out_put_batch; + goto out_put_out; } err = i915_vma_pin(vma, 0, 0,