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:   Mon, 6 Mar 2017 10:45:50 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Arvind Yadav <arvind.yadav.cs@...il.com>
Cc:     Henrique de Moraes Holschuh <ibm-acpi@....eng.br>,
        "dvhart@...radead.org" <dvhart@...radead.org>,
        Andy Shevchenko <andy@...radead.org>,
        ibm-acpi-devel@...ts.sourceforge.net,
        Platform Driver <platform-driver-x86@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86: thinkpad_acpi: Handle return error.

On Mon, Mar 6, 2017 at 9:43 AM, Arvind Yadav <arvind.yadav.cs@...il.com> wrote:
> This patch is for handling a return error.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
> ---
>  drivers/platform/x86/thinkpad_acpi.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index 1d18b32..19ad3ec 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -1237,9 +1237,11 @@ static int tpacpi_rfk_hook_set_block(void *data, bool blocked)
>         /* try to set radio state */

>         res = (tp_rfk->ops->set_status)(blocked ?
>                                 TPACPI_RFK_RADIO_OFF : TPACPI_RFK_RADIO_ON);

Just in case: first parens are redundant here.

> +       if (res < 0)
> +               return res;

So, this changes behaviour. Before we call _rfk_update_swstate()
independently on error code.

Care to explain in commit message how this change does / does not
affect overall user experience?

>         /* and update the rfkill core with whatever the FW really did */
> -       tpacpi_rfk_update_swstate(tp_rfk);
> +       res = tpacpi_rfk_update_swstate(tp_rfk);
>
>         return (res < 0) ? res : 0;
>  }

> @@ -3517,6 +3524,8 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
>         if (tp_features.hotkey_wlsw)
>                 res = add_to_attr_set(hotkey_dev_attributes,
>                                 &dev_attr_hotkey_radio_sw.attr);
> +       if (res)
> +               goto err_exit;
>
>         res = hotkey_init_tablet_mode();
>         if (res < 0)

Ditto for hotkey_init_tablet_mode().

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ