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/