From patchwork Sat Jan 29 01:17:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Achatz X-Patchwork-Id: 516261 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0T1Hbnw031602 for ; Sat, 29 Jan 2011 01:17:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754744Ab1A2BRg (ORCPT ); Fri, 28 Jan 2011 20:17:36 -0500 Received: from mail-in-01.arcor-online.net ([151.189.21.41]:54622 "EHLO mail-in-01.arcor-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754722Ab1A2BRf (ORCPT ); Fri, 28 Jan 2011 20:17:35 -0500 Received: from mail-in-02-z2.arcor-online.net (mail-in-02-z2.arcor-online.net [151.189.8.14]) by mx.arcor.de (Postfix) with ESMTP id 6DFA65A648; Sat, 29 Jan 2011 02:17:33 +0100 (CET) Received: from mail-in-16.arcor-online.net (mail-in-16.arcor-online.net [151.189.21.56]) by mail-in-02-z2.arcor-online.net (Postfix) with ESMTP id 66DC11756D0; Sat, 29 Jan 2011 02:17:33 +0100 (CET) Received: from [192.168.0.7] (dslb-084-057-042-012.pools.arcor-ip.net [84.57.42.12]) (Authenticated sender: screamingfist@arcor.de) by mail-in-16.arcor-online.net (Postfix) with ESMTPSA id D8EBC87C1; Sat, 29 Jan 2011 02:17:31 +0100 (CET) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-16.arcor-online.net D8EBC87C1 Subject: [PATCH] HID: hidraw: fixed hidraw_disconnect() From: Stefan Achatz Reply-To: erazor_de@users.sourceforge.net To: Jiri Kosina , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 29 Jan 2011 02:17:30 +0100 Message-ID: <1296263850.2299.11.camel@neuromancer> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 (2.30.3-1.fc13) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.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, 29 Jan 2011 01:17:38 +0000 (UTC) diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index 468e87b..5516ea4 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c @@ -428,12 +428,12 @@ void hidraw_disconnect(struct hid_device *hid) hidraw->exist = 0; + device_destroy(hidraw_class, MKDEV(hidraw_major, hidraw->minor)); + mutex_lock(&minors_lock); hidraw_table[hidraw->minor] = NULL; mutex_unlock(&minors_lock); - device_destroy(hidraw_class, MKDEV(hidraw_major, hidraw->minor)); - if (hidraw->open) { hid_hw_close(hid); wake_up_interruptible(&hidraw->wait);