From patchwork Sat Jun 25 05:53:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 918082 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5P5sTYr007767 for ; Sat, 25 Jun 2011 05:54:50 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6439B9E73D for ; Fri, 24 Jun 2011 22:54:29 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pw0-f49.google.com (mail-pw0-f49.google.com [209.85.160.49]) by gabe.freedesktop.org (Postfix) with ESMTP id C2B449E746 for ; Fri, 24 Jun 2011 22:54:17 -0700 (PDT) Received: by pwi3 with SMTP id 3so2518702pwi.36 for ; Fri, 24 Jun 2011 22:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=SP+6O4XM61jfyhfA7JHZrI3gmfsjqxuAFtjZL3s7sGQ=; b=o0dF8l3yeajaIx90LcigXEn8WHdaEBMb7KXEQRGOlklHM3w05c2KjoDot0mxv/fTM7 W1DzdnjRwjNtcsLJmhnEGmDugaBdDqRWu4XUFKIOvu73jzkQPuZQRd2/eH46+cXsnNYt ww4no0SUVUWdoNKYlt4+FPAN3pdu2iUsCL7uQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=vSqxFX7yGPkTyyzr7OvVVoNfADWXx8p6c6W2FS0R6kjLFz+KYypZuxTXRl0qYng44p GKkEiyPQhCgz0k/427d+TmnkWRLiD/VmFQ++1xQ2BirwPCfpPwn9LN7fQoboyTklAoup TlcXEpO+JM8yNjwhnBDaW56hcmX5eU0exN//4= Received: by 10.142.225.17 with SMTP id x17mr787723wfg.227.1308981257681; Fri, 24 Jun 2011 22:54:17 -0700 (PDT) Received: from shale.localdomain ([41.139.221.94]) by mx.google.com with ESMTPS id n9sm2657562wfk.8.2011.06.24.22.54.12 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 24 Jun 2011 22:54:17 -0700 (PDT) Date: Sat, 25 Jun 2011 08:53:24 +0300 From: Dan Carpenter To: Ben Skeggs Subject: [patch] nouveau: free the memory in nouveau_gart_manager_del() Message-ID: <20110625055324.GS14591@shale.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: kernel-janitors@vger.kernel.org, Roy Spliet , "open list:DRM DRIVERS" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 25 Jun 2011 05:54:50 +0000 (UTC) In the original code the kfree() doesn't do anything because "mem->mm_node" has been set to NULL. This was introduced in d2f96666c56a "drm/nouveau: create temp vmas for both src and dst of bo moves" Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c index 765f0e5..ab79bf8 100644 --- a/drivers/gpu/drm/nouveau/nouveau_mem.c +++ b/drivers/gpu/drm/nouveau/nouveau_mem.c @@ -846,8 +846,8 @@ nouveau_gart_manager_del(struct ttm_mem_type_manager *man, struct ttm_mem_reg *mem) { nouveau_mem_node_cleanup(mem->mm_node); - mem->mm_node = NULL; kfree(mem->mm_node); + mem->mm_node = NULL; } static int