[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200709050050.14259.dtor@insightbb.com>
Date: Wed, 5 Sep 2007 00:50:13 -0400
From: Dmitry Torokhov <dtor@...ightbb.com>
To: Mike Frysinger <vapier@...too.org>
Cc: linuxsh-dev@...ts.sourceforge.net,
Adrian McMenamin <lkmladrian@...il.com>,
Paul Mundt <lethal@...ux-sh.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Add support for keyboard on SEGA Dreamcast
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 majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists