Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp321596pxb; Wed, 20 Oct 2021 23:33:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXgsMds0X4nB+4GwxCbg3rWc8IALHmqnHJriOSDThXJrp2d4DmAEv1ao0IHvi70V6OWJSS X-Received: by 2002:a17:906:c20e:: with SMTP id d14mr5023414ejz.207.1634798036363; Wed, 20 Oct 2021 23:33:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634798036; cv=none; d=google.com; s=arc-20160816; b=gkUQ37Xp55nygvEfG2kXYUNam/L4iBr19oE0E+DqZ0hUFhLrHaaSF2ElVKtI2tHUDJ nqu1L3Kg4quwNm4U7g0CBd8UQ8b5mCkGWXyTRxe2OHlgU2CnaRffH5AA2gbmtWn1+M9Q EHuonIIooI5JydNyifkIk7umBnSqn4TaAZ4AxLCGFY3v1BSIswmubePq5ni6OlVdRBYe duPN1JvPhh9ugo+rRuexqOWDgfkUW+R9F19eBi4aMF4Pbnlf2CCslHzxxMFuFJSCZ1ab VXXXGNE6Wr4DgqHajSUOAsXAHpZw9rGG3Flz5k5kY5Ylwa6i6NfNCLGq+kXRd/05Zu+W Ur3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date; bh=+MoP7ivlJMPx5ez93IxoV3anyI2B48rLz2oroOWzfjw=; b=un3eG8Yo3a7e72gRgipo18DqNmXVIHCFyVoFX29W+lYfiyCEF3qw6Qm60zw9iJtPpr zQBIa69MqPNu4vfBF+nGAG3WjkCa7Xx90lMqkOHUTIrcKfkacyMM6rk8eMm8k8kDZtpQ 3IM7L5G7OlC6w7kVdoHpTXpiVOISEosqmy3HjtivmHlmhbdWXef/U5UC1MWYV5oWPbFA srEVFiVSpmn1nICA3yAjhVYt/tgR6VrEw9a95y7LCWhfTz1SpdlyMkPu9f8GQRb6cD+h kRXc/hR3gjpS69NNWTTOSq3oyvN8tlkLhb+r3qn5YCOHCdzdkW8eFj5KUQcJABc8giQc MFDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f21si10437913edf.59.2021.10.20.23.33.37; Wed, 20 Oct 2021 23:33:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229765AbhJUGes (ORCPT + 63 others); 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-Type: text/plain; charset=us-ascii 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 --- 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; }