lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 19 Apr 2017 19:21:20 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Carlo Caione <carlo@...one.org>
Cc:     "dvhart@...radead.org" <dvhart@...radead.org>,
        Andy Shevchenko <andy@...radead.org>,
        Platform Driver <platform-driver-x86@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        linux@...lessm.com, Carlo Caione <carlo@...lessm.com>
Subject: Re: [PATCH 1/2] hp-wmi: Fix error value for hp_wmi_tablet_state

On Sun, Apr 9, 2017 at 4:56 PM, Carlo Caione <carlo@...one.org> wrote:
> From: Carlo Caione <carlo@...lessm.com>
>
> hp_wmi_tablet_state() fails to return the correct error code when
> hp_wmi_perform_query() returns the HP WMI query specific error code
> that is a positive value.

>         int ret = hp_wmi_perform_query(HPWMI_HARDWARE_QUERY, 0, &state,
>                                        sizeof(state), sizeof(state));
>         if (ret)
> -               return ret;
> +               return -EINVAL;

Shouldn't be something like

if (ret)
 return ret < 0 ? ret : -EINVAL;

Looking into the code it looks like it may return all possible values:
0, negative, positive.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ