Markus Armbruster wrote: > Review below. >> + kbd = input_allocate_device(); >> + ptr = input_allocate_device(); >> + if (!kbd || !ptr) >> goto error_nomem; > > If just one of two fails, the other is leaked, I fear. Yep, you are right, fixed version attached. > It *might* be simpler to have something like > > error: > if (ptr) > input_free_device(ptr); > if (kbd) > input_free_device(kbd); I don't think it would simplify the code because you'll have to take care then that the xenkbd_remove() call in the error path doesn't result in a double-free ... cheers, Gerd -- Gerd Hoffmann