From patchwork Thu Oct 21 06:32:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Lo X-Patchwork-Id: 12574013 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57B29C433F5 for ; Thu, 21 Oct 2021 06:32:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 37EF161212 for ; Thu, 21 Oct 2021 06:32:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229765AbhJUGes (ORCPT ); Thu, 21 Oct 2021 02:34:48 -0400 Received: from ns.kevlo.org ([220.134.220.36]:17240 "EHLO mail.kevlo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231357AbhJUGep (ORCPT ); Thu, 21 Oct 2021 02:34:45 -0400 Received: from localhost (ns.kevlo.org [local]) by ns.kevlo.org (OpenSMTPD) with ESMTPA id 8ab2145d; Thu, 21 Oct 2021 14:32:27 +0800 (CST) Date: Thu, 21 Oct 2021 14:32:27 +0800 From: Kevin Lo To: linux-wireless@vger.kernel.org Cc: Pkshih Subject: [PATCH wireless-drivers-next] rtw89: fix return value in hfc_pub_cfg_chk Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 Acked-by: Ping-Ke Shih 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 = ¶m->pub_cfg; if (pub_cfg->grp0 + pub_cfg->grp1 != pub_cfg->pub_max) - return 0; + return -EFAULT; return 0; }