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@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
This commit is contained in:
Kevin Lo 2021-10-21 14:32:27 +08:00 committed by Kalle Valo
parent 090f8a2f7b
commit c6477cb237

View 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; const struct rtw89_hfc_pub_cfg *pub_cfg = &param->pub_cfg;
if (pub_cfg->grp0 + pub_cfg->grp1 != pub_cfg->pub_max) if (pub_cfg->grp0 + pub_cfg->grp1 != pub_cfg->pub_max)
return 0; return -EFAULT;
return 0; return 0;
} }