From patchwork Mon Jul 23 08:27:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1227021 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 E94C13FCFC for ; Mon, 23 Jul 2012 09:36:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C97659F379 for ; Mon, 23 Jul 2012 02:36:03 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bk0-f49.google.com (mail-bk0-f49.google.com [209.85.214.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 886789EF92 for ; Mon, 23 Jul 2012 02:33:50 -0700 (PDT) Received: by mail-bk0-f49.google.com with SMTP id ji2so4803076bkc.36 for ; Mon, 23 Jul 2012 02:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=2wqMydC3baG/coRVByFR+sXMBOK+CNZN6ktG6D1eyTs=; b=LWWeADXxZF2O+OJVQgRLO3dI2eh9P7CfN6m93K4xp9WiUrbyoqTIcjfsnH33blVmrV Ld1EEOH9x2xweIOC/2v8lyCK9UEYn2F2EwNdpsiRy0YnkfOxNrYpBd6HS5KXWRfDoDuz eylX8DNobIFV9xPL+/9Z5BxCBbkuw2r4joO+g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=2wqMydC3baG/coRVByFR+sXMBOK+CNZN6ktG6D1eyTs=; b=ekgWyQ+997C1uF1oGek5ZNJB7LV4tISeBx8MMSxt4Pg9O0E0233zRipdohmqgYAfpm DoT20/E5wKXTY0mKRxkmTxCyieMgRi3TfZp54AN21GSfj9U1qndCQgwfyaleK1wCIOgG cmLpq8RVsN35vglc2mLHkbGDu3JLuBpdQrQpvvvWnWqT0CYIDtfHwOEKhxS4NubED0yD /3BlYkGZfpqsyHakpmT2K9uf0MY9BdeOlZBTByBEeptoHlrNR+Vftzh6Bgk2caZm73ld /NBxKywdMRSh62frkNDk4U3bVf8Vdv15AgTTKWnYF+kHEUkpBuRBLcta9gcGTs4rm0eP l6pw== Received: by 10.204.0.80 with SMTP id 16mr7322962bka.71.1343036030074; Mon, 23 Jul 2012 02:33:50 -0700 (PDT) Received: from wespe.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id 14sm6626763bkq.12.2012.07.23.02.33.48 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 Jul 2012 02:33:49 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 3/3] drm/i915: be more paranoid with the flink name refcounting Date: Mon, 23 Jul 2012 10:27:27 +0200 Message-Id: <1343032047-5713-3-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1343032047-5713-1-git-send-email-daniel.vetter@ffwll.ch> References: <1343032047-5713-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQlGQiqKGzaWxWpaqx+eoOuE69BnlClICbTioOKk/Y8B2j57MTOTlkUG8MF3DVFiSKkfWWT3 Cc: Daniel Vetter 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 We should _never_ call handle_unref without having a name handle. Doing so would be a bug, so yell around about if this happens with a loud WARN_ON. Signed-Off-by: Daniel Vetter --- include/drm/drmP.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 3837e69..d94c6bd 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1677,7 +1677,7 @@ drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj) if (obj == NULL) return; - if (atomic_read(&obj->handle_count) == 0) + if (WARN_ON(atomic_read(&obj->handle_count) == 0)) return; /*