Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937495AbWLEKcq (ORCPT ); Tue, 5 Dec 2006 05:32:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S937450AbWLEKcp (ORCPT ); Tue, 5 Dec 2006 05:32:45 -0500 Received: from pentafluge.infradead.org ([213.146.154.40]:44991 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937423AbWLEKco (ORCPT ); Tue, 5 Dec 2006 05:32:44 -0500 Date: Tue, 5 Dec 2006 10:32:39 +0000 From: Christoph Hellwig To: Ivo van Doorn Cc: Dmitry Torokhov , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, John Linville , Jiri Benc , Lennart Poettering , Johannes Berg , Larry Finger Subject: Re: [RFC] rfkill - Add support for input key to control wireless radio Message-ID: <20061205103239.GA10312@infradead.org> Mail-Followup-To: Christoph Hellwig , Ivo van Doorn , Dmitry Torokhov , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, John Linville , Jiri Benc , Lennart Poettering , Johannes Berg , Larry Finger References: <200612031936.34343.IvDoorn@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200612031936.34343.IvDoorn@gmail.com> User-Agent: Mutt/1.4.2.2i X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 942 Lines: 32 > +/* > + * Function called by the key driver when the rfkill structure > + * needs to be registered. > + */ > +int rfkill_register_key(struct rfkill *rfkill, int init_status) > +{ > + struct rfkill_type *type = &master->type[rfkill->key_type]; > + struct rfkill_key *key; > + int status; > + > + if (!rfkill) > + return -EINVAL; > + > + if (rfkill->key_type >= KEY_TYPE_MAX) > + return -EINVAL; > + > + /* > + * Increase module use count to prevent this > + * module to be unloaded while there are still > + * registered keys. > + */ > + if (!try_module_get(THIS_MODULE)) > + return -EBUSY; This is obviously broken. Please add a "struct module *owner;" field to struct rfkill instead. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/