From: Dmitry Torokhov <dtor@insightbb.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: linuxsh-dev@lists.sourceforge.net,
Adrian McMenamin <lkmladrian@gmail.com>,
Paul Mundt <lethal@linux-sh.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Add support for keyboard on SEGA Dreamcast
Date: Wed, 5 Sep 2007 00:50:13 -0400 [thread overview]
Message-ID: <200709050050.14259.dtor@insightbb.com> (raw)
In-Reply-To: <200709050034.57010.vapier@gentoo.org>
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
prev parent reply other threads:[~2007-09-05 4:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-04 23:34 [PATCH] Add support for keyboard on SEGA Dreamcast Adrian McMenamin
2007-09-05 3:04 ` Dmitry Torokhov
2007-09-07 22:01 ` Adrian McMenamin
2007-09-05 4:34 ` Mike Frysinger
2007-09-05 4:50 ` Dmitry Torokhov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200709050050.14259.dtor@insightbb.com \
--to=dtor@insightbb.com \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxsh-dev@lists.sourceforge.net \
--cc=lkmladrian@gmail.com \
--cc=vapier@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.