From patchwork Sun Oct 20 16:55:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 3073481 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DAE8CBF924 for ; Sun, 20 Oct 2013 16:58:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1B4912027C for ; Sun, 20 Oct 2013 16:58:30 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4642B20258 for ; Sun, 20 Oct 2013 16:58:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 30900E718B for ; Sun, 20 Oct 2013 09:58:29 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ea0-f178.google.com (mail-ea0-f178.google.com [209.85.215.178]) by gabe.freedesktop.org (Postfix) with ESMTP id 95D79E7154 for ; Sun, 20 Oct 2013 09:56:01 -0700 (PDT) Received: by mail-ea0-f178.google.com with SMTP id a15so2955771eae.23 for ; Sun, 20 Oct 2013 09:56:00 -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:in-reply-to:references; bh=8XqBkvBJ+bLorOxQwD0TCqxHgvDYxd+IEkNQBa6W3Dc=; b=ax2fgNpGdCL5j/G9mssoMMfWlbBfgoAGzt51h9osMvkqCq0jILFbqRr0EssNn+FILr bcksC84XzmXKwbRHTiaS59OFT8NTsyNCqaiRPH5cmMpUg/rY3ZBSSJFZ8lozycbIAAxt 4v8HNgRUId32IrSf/1y5tNs9bnfsIzf+2KRIwiChZateG3GvR85QLEkvjm5OEWzBsgqR qsWkCMlN4y2HFuHyuhfRVTd5vn76lWLumQuhOa4kUtW5hMc5MQHjohJdo9/d8Jw8rrm9 W1JvLwzddJ+b848//vU4BmDlunlOsf9HAYhU/aWj0ENGn2ASHI0T4QM/4pzEGg3R2G0u CiOg== X-Received: by 10.15.93.204 with SMTP id w52mr319104eez.69.1382288160896; Sun, 20 Oct 2013 09:56:00 -0700 (PDT) Received: from localhost.localdomain (stgt-5f71a68b.pool.mediaWays.net. [95.113.166.139]) by mx.google.com with ESMTPSA id e13sm32704479eeu.4.2013.10.20.09.55.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Oct 2013 09:56:00 -0700 (PDT) From: David Herrmann To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/6] drm: cleanup debugfs in drm_unplug_minor() Date: Sun, 20 Oct 2013 18:55:43 +0200 Message-Id: <1382288145-1776-4-git-send-email-dh.herrmann@gmail.com> X-Mailer: git-send-email 1.8.4.1 In-Reply-To: <1382288145-1776-1-git-send-email-dh.herrmann@gmail.com> References: <1382288145-1776-1-git-send-email-dh.herrmann@gmail.com> 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 X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 There is no reason to delay debugfs-cleanup to drm_put_minor(). We should forbid any access to debugfs files once the device is dead. Chances they oops once a card was unplugged are very high, anyway. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_stub.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 7feed52..5bf4339 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c @@ -341,6 +341,10 @@ static void drm_unplug_minor(struct drm_minor *minor) if (!minor || !device_is_registered(&minor->kdev)) return; +#if defined(CONFIG_DEBUG_FS) + drm_debugfs_cleanup(minor); +#endif + drm_sysfs_device_remove(minor); } @@ -360,10 +364,6 @@ static void drm_put_minor(struct drm_minor *minor) DRM_DEBUG("release secondary minor %d\n", minor->index); -#if defined(CONFIG_DEBUG_FS) - drm_debugfs_cleanup(minor); -#endif - drm_unplug_minor(minor); idr_remove(&drm_minors_idr, minor->index);