Re: [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device

2007-10-29 Thread Dirk Hohndel
[sorry - mail config screwup caused this to bounce for the more restrictive of the recipient addresses, including the mailing lists, so resending again] On Mon, Oct 29, 2007 at 06:28:36PM +0100, Jiri Kosina wrote:

Re: [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device

2007-10-29 Thread Jiri Kosina
On Mon, 29 Oct 2007, Dirk Hohndel wrote: > hidinput = kzalloc(sizeof(*hidinput), GFP_KERNEL); > input_dev = input_allocate_device(); > if (!hidinput || !input_dev) { > kfree(hidinput); > input_free_device(input_dev); > This either passes a NULL pointer

Re: [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device

2007-10-29 Thread Dmitry Torokhov
On 10/29/07, Hohndel, Dirk <[EMAIL PROTECTED]> wrote: > > On Oct 29, 2007, at 8:33 AM, Dmitry Torokhov wrote: > > > On 10/29/07, Dirk Hohndel <[EMAIL PROTECTED]> wrote: > >> > >> Actually, the more I look at the code that bails when it runs out > >> of memory, > >> the more I wonder about that. > >

Re: [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device

2007-10-29 Thread Hohndel, Dirk
On Oct 29, 2007, at 8:33 AM, Dmitry Torokhov wrote: On 10/29/07, Dirk Hohndel <[EMAIL PROTECTED]> wrote: Actually, the more I look at the code that bails when it runs out of memory, the more I wonder about that. hidinput = kzalloc(sizeof(*hidinput), GFP_KERNEL); input_dev =

Re: [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device

2007-10-29 Thread Dmitry Torokhov
On 10/29/07, Dirk Hohndel <[EMAIL PROTECTED]> wrote: > > Actually, the more I look at the code that bails when it runs out of memory, > the more I wonder about that. > >hidinput = kzalloc(sizeof(*hidinput), GFP_KERNEL); >input_dev = input_allocate_device(); >if (!hidinput ||

Re: [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device

2007-10-29 Thread Dirk Hohndel
On Mon, Oct 29, 2007 at 10:49:03AM -0400, Jeff Garzik wrote: > Dmitry Torokhov wrote: > > On 10/29/07, Jiri Kosina <[EMAIL PROTECTED]> wrote: > >> On Mon, 29 Oct 2007, Dirk Hohndel wrote: > >> > >>> [INPUT] hidinput_connect incorrectly ignored return value from > >>> input_register_device > >>> Si

Re: [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device

2007-10-29 Thread Jeff Garzik
Dmitry Torokhov wrote: On 10/29/07, Jiri Kosina <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> Will apply Please don't - the fix is compl

Re: [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device

2007-10-29 Thread Jiri Kosina
On Mon, 29 Oct 2007, Dmitry Torokhov wrote: > 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

Re: [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device

2007-10-29 Thread Dmitry Torokhov
On 10/29/07, Jiri Kosina <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> > > Will apply Please don't - the fix is completely brok

Re: [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device

2007-10-29 Thread Jiri Kosina
On Mon, 29 Oct 2007, Dirk Hohndel wrote: > [INPUT] hidinput_connect incorrectly ignored return value from > input_register_device > Signed-off-by: Dirk Hohndel <[EMAIL PROTECTED]> Will apply, thanks a lot. -- Jiri Kosina - To unsubscribe from this list: send the line "unsubscribe linux-kernel"

Re: [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device

2007-10-29 Thread Jeff Garzik
Dirk Hohndel wrote: [INPUT] hidinput_connect incorrectly ignored return value from input_register_device Signed-off-by: Dirk Hohndel <[EMAIL PROTECTED]> --- drivers/hid/hid-input.c | 12 ++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-input.c b/d

Re: [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device

2007-10-29 Thread Dirk Hohndel
On Mon, Oct 29, 2007 at 03:53:14AM -0400, Jeff Garzik wrote: > > You would also want to kfree(hidinput) on failure too. Oops, of course. Thanks for catching that. Here's the updated patch /D [INPUT] hidinput_connect incorrectly ignored return value from input_register_device Signed-off-by: D

Re: [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device

2007-10-28 Thread Jeff Garzik
Dirk Hohndel wrote: [INPUT] hidinput_connect incorrectly ignored return value from input_register_device Signed-off-by: Dirk Hohndel <[EMAIL PROTECTED]> --- drivers/hid/hid-input.c | 10 -- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-input.c b/driv

[PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device

2007-10-28 Thread Dirk Hohndel
[INPUT] hidinput_connect incorrectly ignored return value from input_register_device Signed-off-by: Dirk Hohndel <[EMAIL PROTECTED]> --- drivers/hid/hid-input.c | 10 -- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c in