Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753495AbcKNOLQ (ORCPT ); Mon, 14 Nov 2016 09:11:16 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:60342 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751396AbcKNOLO (ORCPT ); Mon, 14 Nov 2016 09:11:14 -0500 Date: Mon, 14 Nov 2016 15:11:23 +0100 From: Greg KH To: Heikki Krogerus Cc: Guenter Roeck , Oliver Neukum , Felipe Balbi , Bin Gao , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATHCv10 1/2] usb: USB Type-C connector class Message-ID: <20161114141123.GA21395@kroah.com> References: <20160919111657.22127-1-heikki.krogerus@linux.intel.com> <20160919111657.22127-2-heikki.krogerus@linux.intel.com> <20161114095148.GA10306@kroah.com> <20161114123235.GD22706@kuha.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161114123235.GD22706@kuha.fi.intel.com> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 490 Lines: 16 On Mon, Nov 14, 2016 at 02:32:35PM +0200, Heikki Krogerus wrote: > > > +static void __exit typec_exit(void) > > > +{ > > > + class_unregister(&typec_class); > > > > You forgot to clean up your idr :( > > Sorry, what idr? The port ids get removed in typec_release(). You have a static idr structure in the driver, right? You have to clean it up when your code is going away so that it will free any memory it had allocated with a call to idr_destroy() on module exit. thanks, greg k-h