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]
Message-ID: <79fd583078414f2f8c137c85bcdebef7@realtek.com>
Date:   Wed, 1 Mar 2023 01:51:31 +0000
From:   Ping-Ke Shih <pkshih@...ltek.com>
To:     Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
        "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kvalo@...nel.org" <kvalo@...nel.org>,
        "tony0620emma@...il.com" <tony0620emma@...il.com>,
        Neo Jou <neojou@...il.com>
Subject: RE: [PATCH v1 wireless-next 2/2] wifi: rtw88: mac: Return the original error from rtw_mac_power_switch()



> -----Original Message-----
> From: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
> Sent: Monday, February 27, 2023 6:10 AM
> To: linux-wireless@...r.kernel.org
> Cc: netdev@...r.kernel.org; linux-kernel@...r.kernel.org; kvalo@...nel.org; tony0620emma@...il.com;
> Ping-Ke Shih <pkshih@...ltek.com>; Neo Jou <neojou@...il.com>; Martin Blumenstingl
> <martin.blumenstingl@...glemail.com>
> Subject: [PATCH v1 wireless-next 2/2] wifi: rtw88: mac: Return the original error from
> rtw_mac_power_switch()
> 
> rtw_mac_power_switch() calls rtw_pwr_seq_parser() which can return
> -EINVAL, -EBUSY or 0. Propagate the original error code instead of
> unconditionally returning -EINVAL in case of an error.
> 
> Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@...glemail.com>

Reviewed-by: Ping-Ke Shih <pkshih@...ltek.com>

> ---
>  drivers/net/wireless/realtek/rtw88/mac.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/mac.c b/drivers/net/wireless/realtek/rtw88/mac.c
> index 4749d75fefee..f3a566cf979b 100644
> --- a/drivers/net/wireless/realtek/rtw88/mac.c
> +++ b/drivers/net/wireless/realtek/rtw88/mac.c
> @@ -250,6 +250,7 @@ static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on)
>         const struct rtw_pwr_seq_cmd **pwr_seq;
>         u8 rpwm;
>         bool cur_pwr;
> +       int ret;
> 
>         if (rtw_chip_wcpu_11ac(rtwdev)) {
>                 rpwm = rtw_read8(rtwdev, rtwdev->hci.rpwm_addr);
> @@ -273,8 +274,9 @@ static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on)
>                 return -EALREADY;

I think a reason why we don't propagate return value is special deal of EALREADY
by caller. Since this driver becomes stable and no others use EALREADY as error code,
this patchset will be okay.

> 
>         pwr_seq = pwr_on ? chip->pwr_on_seq : chip->pwr_off_seq;
> -       if (rtw_pwr_seq_parser(rtwdev, pwr_seq))
> -               return -EINVAL;
> +       ret = rtw_pwr_seq_parser(rtwdev, pwr_seq);
> +       if (ret)
> +               return ret;
> 
>         if (pwr_on)
>                 set_bit(RTW_FLAG_POWERON, rtwdev->flags);
> --
> 2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ