From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Elias Vanderstuyft <elias.vds@gmail.com>
Cc: Anssi Hannula <anssi.hannula@iki.fi>,
linux-input@vger.kernel.org, wine-devel@winehq.org
Subject: Re: ff-core effect id handling in case of a failed effect upload
Date: Sat, 22 Feb 2014 22:30:43 -0800 [thread overview]
Message-ID: <20140223063043.GB10151@core.coreip.homeip.net> (raw)
In-Reply-To: <CADbOyBSR+CWouAQ+f7VjJcoqiC_J++O7cnjkx+2DqmQorhQ7wg@mail.gmail.com>
On Wed, Feb 19, 2014 at 11:14:18PM +0100, Elias Vanderstuyft wrote:
> On Wed, Feb 19, 2014 at 10:05 PM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > On Wed, Feb 19, 2014 at 06:49:36PM +0200, Anssi Hannula wrote:
> >> (added Dmitry to CC)
> >>
> >> 19.02.2014 13:42, Elias Vanderstuyft kirjoitti:
> >> > Hi,
> >> >
> >>
> >> Hi,
> >>
> >> > In the process of reviewing the Wine DInput translation layer, I
> >> > noticed an inconvenience (in the ff-core implementation?) that can
> >> > possibly lead to confusing problems to application developers (not
> >> > only for Wine), in short:
> >> > If a new (id==-1) effect was uploaded (look at
> >> > ff-core.c::input_ff_upload(...)) that failed (e.g. returning EINVAL),
> >> > ff-core will have assigned a positive number to the effect id. This
> >> > can be confusing because the dev->ff->effects[] array will not contain
> >> > an element at the index of that new effect id.
> >>
> >> I agree that this is a bit confusing, and the kernel code should
> >> probably be modified to not clobber the ioctl-provided effect on failure
> >> (effect->id is set to an "undefined" value, i.e. next free effect slot).
> >>
> >> Dmitry, WDYT?
> >
> > Yeah, it looks like we need to change evdev.c to read:
> >
> > error = input_ff_upload(dev, &effect, file);
> > if (error)
> > return error;
> >
> > if (put_user(effect.id, &(((struct ff_effect __user *)p)->id)))
> > return -EFAULT;
> >
> > return 0;
>
> Alright, who will create the patch?
> Do I may / have to do it?
If you could create the patch that would be appreciated.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2014-02-23 6:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-19 11:42 ff-core effect id handling in case of a failed effect upload Elias Vanderstuyft
2014-02-19 16:49 ` Anssi Hannula
2014-02-19 17:32 ` Elias Vanderstuyft
2014-02-19 19:32 ` Andrew Eikum
2014-02-19 19:49 ` Elias Vanderstuyft
2014-02-19 21:05 ` Dmitry Torokhov
2014-02-19 22:14 ` Elias Vanderstuyft
2014-02-23 6:30 ` Dmitry Torokhov [this message]
2014-02-23 14:27 ` Elias Vanderstuyft
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=20140223063043.GB10151@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=anssi.hannula@iki.fi \
--cc=elias.vds@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=wine-devel@winehq.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).