From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Garzik Subject: Re: [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device Date: Mon, 29 Oct 2007 10:49:03 -0400 Message-ID: <4725F2DF.1060500@garzik.org> References: <20071029084917.GA12968@bigserver.hohndel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: owner-linux-input@atrey.karlin.mff.cuni.cz List-Help: List-Owner: List-Post: List-Unsubscribe: To: Dmitry Torokhov Cc: Jiri Kosina , Dirk Hohndel , linux-input@atrey.karlin.mff.cuni.cz, linux-kernel@vger.kernel.org List-Id: linux-input@vger.kernel.org Dmitry Torokhov wrote: > On 10/29/07, Jiri Kosina wrote: >> On Mon, 29 Oct 2007, Dirk Hohndel wrote: >> >>> [INPUT] hidinput_connect incorrectly ignored return value from >>> input_register_device >>> Signed-off-by: Dirk Hohndel >> Will apply > > Please don't - the fix is completely broken for multi-input devices - > if 2nd device fails to register we bail out of hidinput_connect and > thus never set HID_CLAIMED_INPUT bit. So when we disconnect device we > never call hidinput_disconnect and who knows what will happen after > that. > > hidinput_connect() should properly unwind already registered devices > after failure. Then the existing code to handle hidinput and input_dev allocation failure probably also wants fixing... Dirk's patch was largely following the same logic. Jeff