linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Hannes Reinecke <hare@suse.de>
Cc: Greg KH <greg@kroah.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Vojtech Pavlik <vojtech@suse.cz>
Subject: Re: [PATCH] remove input_call_hotplug (Take#2)
Date: Thu, 20 Jan 2005 08:50:24 -0500	[thread overview]
Message-ID: <d120d500050120055026b5d854@mail.gmail.com> (raw)
In-Reply-To: <41EF640D.60102@suse.de>

On Thu, 20 Jan 2005 08:55:57 +0100, Hannes Reinecke <hare@suse.de> wrote:
> Greg KH wrote:
> > On Wed, Jan 19, 2005 at 02:48:14PM +0100, Hannes Reinecke wrote:
> >
> >>Hi Dmitry,
> >>
> >>attached is the reworked patch for removing the call to
> >>call_usermodehelper from input.c
> >>I've used the 'phys' attribute to generate the device names, this way we
> >>don't need to touch all drivers and the patch itself is nice and small.
> >
> >
> > The main problem of this is the input_dev structures are created
> > statically, right?  Because of this, the release function really doesn't
> > work out correctly I think....
> > 
> That depends on the driver. input_dev is in general a static entry in
> the driver-dependend structure, which in turn may be statically or
> dynamically allocated (depending on whether the driver allows for more
> than one instance of the device to be connected).
> Would dynamic allocation be of any help here?

The concern is the following: you are using class_simple and
class_device structure is embedded into input_dev structure. When you
unregister input_dev class_simple_release will attempt to kfree()
memory occupied by class_device which is bad because it was never
kalloc()ated.

For now, if you continue using class_simple (which is I believe right
solution for now, we have issues with lifetime rules there and it will
take time to resolve everything), you need to dynamically allocate
class_device for input_dev (change cdev to *cdev).

-- 
Dmitry

      reply	other threads:[~2005-01-20 13:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-19 13:48 [PATCH] remove input_call_hotplug (Take#2) Hannes Reinecke
2005-01-19 21:42 ` Greg KH
2005-01-20  7:55   ` Hannes Reinecke
2005-01-20 13:50     ` Dmitry Torokhov [this message]

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=d120d500050120055026b5d854@mail.gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=dtor_core@ameritech.net \
    --cc=greg@kroah.com \
    --cc=hare@suse.de \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).