Re: [PATCH] Add support for keyboard on SEGA Dreamcast

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mike,

On Wednesday 05 September 2007 00:34, Mike Frysinger wrote:
> > +     kbd->dev = input_allocate_device();
> > ...
> > +     retval = input_register_device(kbd->dev);
> > +     if (unlikely(retval))
> > +             goto cleanup;
> > ...
> > +      cleanup:
> > +     kfree(kbd);
> > +     return -EINVAL;
> 
> i'm not familiar with the input layer, but do you need to deallocate that 
> input device if the register fails ?  if so, i guess dc_kbd_disconnect() 
> would need tweaking too ...

No, dc_kbd_disconnect() is fine - the structure is refcounted and so
input core will free it when the last reference drops. But you are
right, input_free_device() is still needed in error path.

-- 
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux