From: Daniel Vetter Subject: Re: [PATCH] drm: check for !kdev in drm_unplug_minor() Date: Thu, 14 Nov 2013 09:52:14 +0100 Message-ID: <20131114085214.GC22741@phenom.ffwll.local> References: <1384339346-31664-1-git-send-email-dh.herrmann@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D28EFB4A5 for ; Thu, 14 Nov 2013 00:51:41 -0800 (PST) Received: by mail-wi0-f179.google.com with SMTP id fb10so2075438wid.12 for ; Thu, 14 Nov 2013 00:51:40 -0800 (PST) Content-Disposition: inline In-Reply-To: <1384339346-31664-1-git-send-email-dh.herrmann@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org To: David Herrmann Cc: Huax Lu , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Wed, Nov 13, 2013 at 11:42:26AM +0100, David Herrmann wrote: > We moved minor deallocation to drm_dev_free() in: > commit 8f6599da8e772fa8de54cdf98e9e03cbaf3946da > Author: David Herrmann > Date: Sun Oct 20 18:55:45 2013 +0200 > > drm: delay minor destruction to drm_dev_free() > > However, this causes a call to drm_unplug_minor(), which should just do > nothing as drm_dev_unregister() already called this. > > But a separate patch caused kdev lifetime changes: > commit 5bdebb183c9702a8c57a01dff09337be3de337a6 > Author: Dave Airlie > Date: Fri Oct 11 14:07:25 2013 +1000 > > drm/sysfs: sort out minor and connector device object lifetimes. > > Thus making our dev_is_registered() call useles (and even segfault if it > is NULL). Replace it with a simple !kdev test and we're fine. > > Reported-by: Huax Lu > Reported-by: Daniel Vetter > Signed-off-by: David Herrmann Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71208 Tested-by: lu hua Reviewed-by: Daniel Vetter > --- > drivers/gpu/drm/drm_stub.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c > index c200136..f53d524 100644 > --- a/drivers/gpu/drm/drm_stub.c > +++ b/drivers/gpu/drm/drm_stub.c > @@ -338,7 +338,7 @@ err_idr: > */ > static void drm_unplug_minor(struct drm_minor *minor) > { > - if (!minor || !device_is_registered(minor->kdev)) > + if (!minor || !minor->kdev) > return; > > #if defined(CONFIG_DEBUG_FS) > -- > 1.8.4.2 > -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch