From patchwork Wed Apr 24 16:04:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 2485321 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 769C13FCA5 for ; Wed, 24 Apr 2013 16:06:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6DA3CE634A for ; Wed, 24 Apr 2013 09:06:15 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id 2FE74E5F40 for ; Wed, 24 Apr 2013 09:05:53 -0700 (PDT) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 24 Apr 2013 09:05:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,542,1363158000"; d="scan'208";a="231560228" Received: from intelbox.fi.intel.com (HELO localhost) ([10.237.72.70]) by AZSMGA002.ch.intel.com with ESMTP; 24 Apr 2013 09:04:58 -0700 From: Imre Deak To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/prime: warn for non-empty handle lookup list during drm file release Date: Wed, 24 Apr 2013 19:04:57 +0300 Message-Id: <1366819497-8358-1-git-send-email-imre.deak@intel.com> X-Mailer: git-send-email 1.7.10.4 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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 drm_gem_release should release all handles connected to the drm file and so should also release the prime lookup entries of these handles. So just WARN if this isn't the case. Signed-off-by: Imre Deak Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_prime.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 71c7315..dcde352 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -488,11 +488,8 @@ EXPORT_SYMBOL(drm_prime_init_file_private); void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv) { - struct drm_prime_member *member, *safe; - list_for_each_entry_safe(member, safe, &prime_fpriv->head, entry) { - list_del(&member->entry); - kfree(member); - } + /* by now drm_gem_release should've made sure the list is empty */ + WARN_ON(!list_empty(&prime_fpriv->head)); } EXPORT_SYMBOL(drm_prime_destroy_file_private);