lkml.org 
[lkml]   [2012]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv3 2/4] Input: keypad: Add smsc ece1099 keypad driver
On Wed, Oct 03, 2012 at 11:26:46AM +0530, Poddar, Sourav wrote:
> Hi Dmitry,
>
> On Tue, Oct 2, 2012 at 11:48 AM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > Hi Sourav,
> >
> > On Mon, Oct 01, 2012 at 04:31:50PM +0530, Sourav Poddar wrote:
> >> From: G, Manjunath Kondaiah <manjugk@ti.com>
> >>
> >> +
> >> + /* Enable smsc keypad interrupts */
> >> + ret = smsc_write(dev, SMSC_KP_INT_MASK, 0xff);
> >> + if (ret < 0)
> >> + goto err2;
> >> +
> >> + return 0;
> >> +
> >> +err2:
> >> + input_unregister_device(input);
> >> +err1:
> >> + input_free_device(input);
> >
> > Double free.
> >
> I believe what you are trying to say here is that we dont really
> need a " input_unregister_device" (as also I checked in other keypad
> implementations) and do a "unregister_device" in the remove api ??

What I was trying to say is that if input device has been registered
then you need to call input_unregister_device() to unregister and free
it, otherwise you need to call input_free_device(), but not both.

Thanks.

--
Dmitry


\
 
 \ /
  Last update: 2012-10-04 10:01    [W:0.123 / U:1.668 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site