public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vernon Mauery <vernux@us.ibm.com>
To: Dmitry Torokhov <dtor_core@ameritech.net>
Cc: Linus Torvalds <torvalds@osdl.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>, Vojtech Pavlik <vojtech@suse.cz>
Subject: Re: [PATCH 24/24] ibmasm: convert to dynamic input_dev allocation
Date: Mon, 09 Jan 2006 10:23:31 -0800	[thread overview]
Message-ID: <43C2AA23.4060107@us.ibm.com> (raw)
In-Reply-To: <20060107172102.339318000.dtor_core@ameritech.net>

Dmitry Torokhov wrote:
> From: Vernon Mauery <vernux@us.ibm.com>,
> 
> Input: ibmasm - convert to dynamic input_dev allocation
> 
> Update the ibmasm driver to use the dynamic allocation of input_dev
> structs to work with the sysfs subsystem.
> 
> Vojtech: Fixed some problems/bugs in the patch.
> Dmitry: Fixed some more.
> 
> Signed-off-by: Vernon Mauery <vernux@us.ibm.com>
> Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
> ---
> 
>  drivers/misc/ibmasm/ibmasm.h |    6 +--
>  drivers/misc/ibmasm/remote.c |   82 +++++++++++++++++++++++++------------------
>  2 files changed, 51 insertions(+), 37 deletions(-)
> 

> Index: work/drivers/misc/ibmasm/remote.c
> ===================================================================
> --- work.orig/drivers/misc/ibmasm/remote.c
> +++ work/drivers/misc/ibmasm/remote.c

[snip]

>  
> -	input_register_device(&remote->mouse_dev);
> -	input_register_device(&remote->keybd_dev);
> +	error = input_register_device(mouse_dev);
> +	if (error)
> +		goto err_free_devices;
> +
> +	error = input_register_device(keybd_dev);
> +	if (error)
> +		goto err_unregister_mouse_dev;
> +
>  	enable_mouse_interrupts(sp);
>  
>  	printk(KERN_INFO "ibmasm remote responding to events on RSA card %d\n", sp->number);
>  
>  	return 0;
> +
> + err_unregister_mouse_dev:
> +	input_unregister_device(mouse_dev);

If I understand the API correctly now, shouldn't there be a
	mouse_dev = NULL;
right here to prevent the following input_free_device?

--Vernon

> + err_free_devices:
> +	input_free_device(mouse_dev);
> +	input_free_device(keybd_dev);
> +
> +	return error;
>  }
>  
>  void ibmasm_free_remote_input_dev(struct service_processor *sp)
>  {
>  	disable_mouse_interrupts(sp);
> -	input_unregister_device(&sp->remote->keybd_dev);
> -	input_unregister_device(&sp->remote->mouse_dev);
> -	kfree(sp->remote);
> +	input_unregister_device(sp->remote.mouse_dev);
> +	input_unregister_device(sp->remote.keybd_dev);
>  }
>  
> 
> -
> 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/
> 
> 


  reply	other threads:[~2006-01-09 18:23 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-07 17:15 [PATCH 00/24] Input patches for 2.6.15 Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 01/24] evdev: consolidate compat and normal code Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 02/24] Mousedev: make module parameters visible in sysfs Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 03/24] logips2pp: add new signature (85) Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 04/24] Wistron: add Acer TravelMate 240 to DMI table Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 05/24] add the fn key to hid-debug.h Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 06/24] Add Geyser 2 support to appletouch driver Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 07/24] alps: add signature for HP ze1115 Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 08/24] psmouse: dont leave mouse asleep Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 09/24] i8042: disable MUX mode for Sharp MM20 Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 10/24] Add help entry for FM801 gameport driver to Kconfig Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 11/24] lifebook: add DMI signature of Fujitsu Lifebook B142 Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 12/24] pcspkr: register with driver core as a platfrom device Dmitry Torokhov
2006-01-10  6:41   ` Benjamin Herrenschmidt
2006-01-10  6:48     ` Dmitry Torokhov
2006-01-10  7:04       ` Benjamin Herrenschmidt
2006-01-10  7:09         ` Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 13/24] m68kspkr: " Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 14/24] sparcspkr: " Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 15/24] logips2pp: add signature of MouseMan Wheel Mouse (87) Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 16/24] i8042: convert to the new platform device interface Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 17/24] ct82c710: " Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 18/24] maceps2: " Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 19/24] q40kbd: " Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 20/24] Wistron: switch " Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 21/24] atkbd: dont lose keymap settings when reconnecting keyboard Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 22/24] Add missing keys to hid-debug.h Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 23/24] i8042: Add OQO Zepto to noloop dmi table Dmitry Torokhov
2006-01-07 17:16 ` [PATCH 24/24] ibmasm: convert to dynamic input_dev allocation Dmitry Torokhov
2006-01-09 18:23   ` Vernon Mauery [this message]
2006-01-09 18:30     ` Dmitry Torokhov
2006-01-09 18:31     ` Vernon Mauery

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43C2AA23.4060107@us.ibm.com \
    --to=vernux@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=dtor_core@ameritech.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    --cc=vojtech@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox