On Tue, Mar 20, 2012 at 10:46 PM, Peter Hutterer
<peter.hutte...@who-t.net> wrote:
> Really, this shouldn't ever fail but at least it shuts up some static
> analysers.
>
> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>

Reviewed-by: Ping Cheng <pingli...@gmail.com>

for the whole set. Thank you, Peter, for cleaning up the code.

Ping

> ---
>  src/wcmUSB.c |   11 +++++++++--
>  1 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> index a2d30da..096943e 100644
> --- a/src/wcmUSB.c
> +++ b/src/wcmUSB.c
> @@ -1563,11 +1563,18 @@ static void usbDispatchEvents(InputInfoPtr pInfo)
>        if (!ds->device_type && !dslast.proximity)
>        {
>                unsigned long keys[NBITS(KEY_MAX)] = { 0 };
> +               int rc;
>
>                /* Retrieve the type by asking a resend from the kernel */
> -               ioctl(common->fd, EVIOCGKEY(sizeof(keys)), keys);
> +               rc = ioctl(common->fd, EVIOCGKEY(sizeof(keys)), keys);
> +               if (rc == -1)
> +               {
> +                       xf86Msg(X_ERROR, "%s: failed to retrieve key bits\n",
> +                                       pInfo->name);
> +                       return;
> +               }
>
> -               for (i=0; i < ARRAY_SIZE(wcmTypeToKey); i++)
> +               for (i = 0; i < ARRAY_SIZE(wcmTypeToKey); i++)
>                {
>                        if (ISBITSET(keys, wcmTypeToKey[i].tool_key))
>                        {
> --
> 1.7.7.6
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to