rtw89: fix return value in hfc_pub_cfg_chk
authorKevin Lo <kevlo@kevlo.org>
Thu, 21 Oct 2021 06:32:27 +0000 (14:32 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 27 Oct 2021 07:37:01 +0000 (10:37 +0300)
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@kevlo.org>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/YXEJey8lKksAZif4@ns.kevlo.org
drivers/net/wireless/realtek/rtw89/mac.c

index 69384c4..afcd07a 100644 (file)
@@ -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;
 
        return 0;
 }