From patchwork Fri Sep 11 09:30:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 7158901 Return-Path: X-Original-To: patchwork-dri-devel@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 B9D079F326 for ; Fri, 11 Sep 2015 09:31:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F113D203F1 for ; Fri, 11 Sep 2015 09:31:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id AE2C0203AC for ; Fri, 11 Sep 2015 09:31:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4ECC16E1A6; Fri, 11 Sep 2015 02:31:06 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 644726E1A6 for ; Fri, 11 Sep 2015 02:31:05 -0700 (PDT) Received: by pacfv12 with SMTP id fv12so71674762pac.2 for ; Fri, 11 Sep 2015 02:31:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=JbMB68bXQlrUs2T6ZXNzDH4IUmDCs3lWwjCOIvI9VkU=; b=C13k0jEuKXcaAncR6mz11EUc6p9/YxoMaf8pekILKf47RAD65XfgmCdMPTh5ORmfX7 X+6y7dE3YHgfLebRTLGufL9hn3HbGFn/VMRIauz/+TFMqFWpp30cO9AJnUW+KeAdzXBl hHylej9HW4a89FCP/ETo87NQH1BPpxLTjheNU2/bRYbmPLKFh4uXqK5ala9Oy5dnTARh V+JxS6yYHztRBBYLMehReOJ+qEYEMD6XcWGg1yn/SUFISI0W+uh/q+RJdjFjV4ijw/Hq GV3WgK+hD1I/u+UJa7iLd8PGaW2FvI7Q5jpZzT8phsgiOFU8krdpvGwxH6gs+MvpijGz MAoQ== X-Received: by 10.67.8.106 with SMTP id dj10mr84455211pad.123.1441963864949; Fri, 11 Sep 2015 02:31:04 -0700 (PDT) Received: from localhost.localdomain ([122.169.170.2]) by smtp.gmail.com with ESMTPSA id tq6sm1177846pbc.57.2015.09.11.02.31.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Sep 2015 02:31:04 -0700 (PDT) From: Sudip Mukherjee To: David Airlie Subject: [PATCH] drm/nouveau: fix memory leak Date: Fri, 11 Sep 2015 15:00:56 +0530 Message-Id: <1441963856-17465-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: daniel.vetter@ffwll.ch, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Sudip Mukherjee X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, T_DKIM_INVALID, T_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 If pm_runtime_get_sync() we were going to "out" but we missed freeing vma. Signed-off-by: Sudip Mukherjee --- drivers/gpu/drm/nouveau/nouveau_gem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 2c99815..c05b2f7 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -84,8 +84,10 @@ nouveau_gem_object_open(struct drm_gem_object *gem, struct drm_file *file_priv) } ret = pm_runtime_get_sync(dev); - if (ret < 0 && ret != -EACCES) + if (ret < 0 && ret != -EACCES) { + kfree(vma); goto out; + } ret = nouveau_bo_vma_add(nvbo, cli->vm, vma); if (ret)