From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Peter Hutterer <peter.hutterer@who-t.net>
Cc: David Herrmann <dh.herrmann@gmail.com>,
linux-input@vger.kernel.org, Jiri Kosina <jkosina@suse.cz>,
Benjamin Tissoires <benjamin.tissoires@gmail.com>,
Antonio Ospite <ospite@studenti.unina.it>,
linux-kernel@vger.kernel.org, input-tools@lists.freedesktop.org
Subject: Re: [PATCH 2/4] Input: introduce ABS_MAX2/CNT2 and friends
Date: Wed, 18 Dec 2013 15:48:37 -0800 [thread overview]
Message-ID: <1950536.BXYYX85NB4@dtor-d630.eng.vmware.com> (raw)
In-Reply-To: <20131218234009.GA9360@yabbi.redhat.com>
On Thursday, December 19, 2013 09:40:09 AM Peter Hutterer wrote:
> > + memset(&abs, 0, sizeof(abs));
> > + for (i = valid_cnt; i < cnt; ++i)
> > + if (copy_to_user(&pinfo->info[i], &abs, sizeof(abs)))
> > + return -EFAULT;
> > +
> > + return 0;
>
> why don't you return the number of valid copied axes to the user?
> that seems better even than forcing the remainder to 0.
Well, if your program messed up buffers that it faulted we do not know
for sure if data that did not cause fault ended up where it should have
or if it smashed something else. This condition I think should be
signaled early.
--
Dmitry
next prev parent reply other threads:[~2013-12-18 23:48 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-17 15:48 [PATCH 0/4] Input: ABS2 and friends David Herrmann
2013-12-17 15:48 ` [PATCH 1/4] Input: uinput: add full absinfo support David Herrmann
2013-12-18 22:27 ` Peter Hutterer
2014-01-12 19:40 ` Dmitry Torokhov
2014-01-12 19:38 ` Dmitry Torokhov
2013-12-17 15:48 ` [PATCH 2/4] Input: introduce ABS_MAX2/CNT2 and friends David Herrmann
2013-12-18 14:27 ` Antonio Ospite
2013-12-18 14:44 ` David Herrmann
2013-12-18 16:36 ` Dmitry Torokhov
2013-12-18 23:21 ` Antonio Ospite
2013-12-18 14:47 ` Dmitry Torokhov
2013-12-18 23:40 ` Peter Hutterer
2013-12-18 23:48 ` Dmitry Torokhov [this message]
2013-12-18 23:55 ` Peter Hutterer
2013-12-19 0:05 ` Dmitry Torokhov
2013-12-19 0:25 ` Peter Hutterer
2013-12-19 0:34 ` Dmitry Torokhov
2013-12-17 15:48 ` [PATCH 3/4] Input: remove ambigious gamepad comment David Herrmann
2013-12-17 15:48 ` [PATCH 4/4] Input: add motion-tracking ABS_* bits and docs David Herrmann
2013-12-18 14:29 ` Antonio Ospite
2013-12-17 16:34 ` [PATCH 0/4] Input: ABS2 and friends David Herrmann
2013-12-17 21:28 ` simon
2013-12-18 8:12 ` David Herrmann
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=1950536.BXYYX85NB4@dtor-d630.eng.vmware.com \
--to=dmitry.torokhov@gmail.com \
--cc=benjamin.tissoires@gmail.com \
--cc=dh.herrmann@gmail.com \
--cc=input-tools@lists.freedesktop.org \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ospite@studenti.unina.it \
--cc=peter.hutterer@who-t.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox