From patchwork Thu Aug 12 12:57:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Kosina X-Patchwork-Id: 119262 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7CCw39s014536 for ; Thu, 12 Aug 2010 12:58:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760016Ab0HLM6B (ORCPT ); Thu, 12 Aug 2010 08:58:01 -0400 Received: from cantor2.suse.de ([195.135.220.15]:45753 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753670Ab0HLM6B (ORCPT ); Thu, 12 Aug 2010 08:58:01 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 0CC978738D; Thu, 12 Aug 2010 14:58:00 +0200 (CEST) Date: Thu, 12 Aug 2010 14:57:57 +0200 (CEST) From: Jiri Kosina To: Markus Trippelsdorf Cc: Heinz Diehl , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-input@vger.kernel.org, Alan Ott , Arnd Bergmann Subject: Re: [BUG] object: is not initialized, yet kobject_put() is being called In-Reply-To: Message-ID: References: <20100810210941.GA7938@fritha.org> <20100810223215.GA1609@arch.tripp.de> <20100812091659.GA1591@arch.tripp.de> <20100812113624.GB1591@arch.tripp.de> <20100812114513.GA1584@arch.tripp.de> <20100812115657.GA1611@arch.tripp.de> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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.3 (demeter.kernel.org [140.211.167.41]); Thu, 12 Aug 2010 12:58:04 +0000 (UTC) diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index 254a003..0dcb79a 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c @@ -266,13 +266,15 @@ static int hiddev_open(struct inode *inode, struct file *file) { struct hiddev_list *list; struct usb_interface *intf; + struct hid_device *hid; struct hiddev *hiddev; int res; intf = usb_find_interface(&hiddev_driver, iminor(inode)); if (!intf) return -ENODEV; - hiddev = usb_get_intfdata(intf); + hid = usb_get_intfdata(intf); + hiddev = hid->hiddev; if (!(list = kzalloc(sizeof(struct hiddev_list), GFP_KERNEL))) return -ENOMEM; @@ -888,7 +890,6 @@ int hiddev_connect(struct hid_device *hid, unsigned int force) hid->hiddev = hiddev; hiddev->hid = hid; hiddev->exist = 1; - usb_set_intfdata(usbhid->intf, usbhid); retval = usb_register_dev(usbhid->intf, &hiddev_class); if (retval) { err_hid("Not able to get a minor for this device.");