[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1950536.BXYYX85NB4@dtor-d630.eng.vmware.com>
Date: Wed, 18 Dec 2013 15:48:37 -0800
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Peter Hutterer <peter.hutterer@...-t.net>
Cc: David Herrmann <dh.herrmann@...il.com>,
linux-input@...r.kernel.org, Jiri Kosina <jkosina@...e.cz>,
Benjamin Tissoires <benjamin.tissoires@...il.com>,
Antonio Ospite <ospite@...denti.unina.it>,
linux-kernel@...r.kernel.org, input-tools@...ts.freedesktop.org
Subject: Re: [PATCH 2/4] Input: introduce ABS_MAX2/CNT2 and friends
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
--
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