Search Linux Wireless

RE: [PATCH wireless-drivers-next] rtw89: fix return value in hfc_pub_cfg_chk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Kevin Lo <kevlo@xxxxxxxxx>
> Sent: Thursday, October 21, 2021 2:32 PM
> To: linux-wireless@xxxxxxxxxxxxxxx
> Cc: Pkshih <pkshih@xxxxxxxxxxx>
> Subject: [PATCH wireless-drivers-next] rtw89: fix return value in hfc_pub_cfg_chk
> 
> It seems to me when pub_cfg->grp0 + pub_cfg->grp1 != pub_cfg->pub_max is true,
> it should return -EFAULT rather than 0.  Otherwise, the function doesn't need
> to exist.
> 
> Signed-off-by: Kevin Lo <kevlo@xxxxxxxxx>

Acked-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>

> ---
> diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
> index 69384c43c046..afcd07ab1de7 100644
> --- a/drivers/net/wireless/realtek/rtw89/mac.c
> +++ b/drivers/net/wireless/realtek/rtw89/mac.c
> @@ -560,7 +560,7 @@ static int hfc_pub_cfg_chk(struct rtw89_dev *rtwdev)
>  	const struct rtw89_hfc_pub_cfg *pub_cfg = &param->pub_cfg;
> 
>  	if (pub_cfg->grp0 + pub_cfg->grp1 != pub_cfg->pub_max)
> -		return 0;
> +		return -EFAULT;

Fortunately, current checking is always equal, so it doesn't affect the result.

> 
>  	return 0;
>  }


--
Ping-Ke




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux