Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3067729rwe; Mon, 29 Aug 2022 05:24:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Qc7J9Nw/DYuUGHusTKZGA7GHwhbD/A3KqtkE9E3t1Pkwi3mLUWb4peAokdY3YH+g0ifxp X-Received: by 2002:a63:4d47:0:b0:42c:2def:6ffc with SMTP id n7-20020a634d47000000b0042c2def6ffcmr3198600pgl.142.1661775890675; Mon, 29 Aug 2022 05:24:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661775890; cv=none; d=google.com; s=arc-20160816; b=iP71FGPM0D8TLb765DXDVSjHqd3OsGjCdedj2olby2fRJE9Tf/BHw5w7IRk/iOvGs3 3SDgq8yyPkmiXaKqCBVP4y2VHJkg1SSlydZdPN/o/KE2v35AzMgsJPN0aEBSqSh4B9ML 4Lzm7RAlh5+raRn2C/2hW5zN//w1fZiQSy/17ZNUwq69MPqX3Gpvdd7XzJvfpwVleHF2 Ul6yL8n8IU+XvgTWQbbzSI6Kt7Jk/vvJXjfhB9gHSbIMMdUkjzAvlZereSscrZ5G+mgA xVRyzkJ+YW6/GDpWPsecDlwOADCKDE3rB8Tk3bRF6tHLRzbvvOsDiVgp1MdHbmgG/pY3 Rvdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=tIm5Ai8WpuDVejwciMKbtkt0BvuDlBKQgWRdOF6t+PY=; b=ZChwSMZVSbIUdc5DVYKg71BnDPSh/N9DRMZ19ncTrwlPPY1KHfkVbneaFHL/11u83G qFRLWvnO2t8gKhheOkDph9uQqcEMQWmfwcv78hH3q4gkGqmR44POUQ0V1NWsYVZwEK5R dfj8lruBDy+Q4fMYT4YX43YuTIjnfX6oXHPTLO77vdilViSvLO6KqaoPaU035VUMtjF3 zWIO3sp6zzkZeAwbxJ3R9XxqtnJPL2N0sa9zzg5FgYSURUTt5itjFotv6ZaE9MQwX62d JAdCYRUCRAnfdZapwuCGv98DPoNhqJ4eMVyX6eqbe/GVzbNl49H4Zd5b4ry8KRzWL8gm vXgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j3-20020a17090a840300b001fd9335c4a5si5587438pjn.108.2022.08.29.05.24.39; Mon, 29 Aug 2022 05:24:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232257AbiH2MYR (ORCPT + 64 others); Mon, 29 Aug 2022 08:24:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230222AbiH2MXv (ORCPT ); Mon, 29 Aug 2022 08:23:51 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 06318A7AB4; Mon, 29 Aug 2022 05:08:19 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 9CBAE1E80D5E; Mon, 29 Aug 2022 19:09:05 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id baIy2p6apqZl; Mon, 29 Aug 2022 19:09:02 +0800 (CST) Received: from localhost.localdomain (unknown [180.167.10.98]) (Authenticated sender: liqiong@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 0D4FF1E80D59; Mon, 29 Aug 2022 19:09:02 +0800 (CST) From: Li Qiong To: Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , "David S . Miller" , Eric Dumazet , Jakub Kicinski Cc: linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yu Zhe , Li Qiong Subject: [PATCH v2] wifi: brcmfmac: add error code in brcmf_notify_sched_scan_results() Date: Mon, 29 Aug 2022 19:12:56 +0800 Message-Id: <20220829111256.21923-1-liqiong@nfschina.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20220829065831.14023-1-liqiong@nfschina.com> References: <20220829065831.14023-1-liqiong@nfschina.com> X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The err code is 0 at the first two "out_err" paths, add error code '-EINVAL' for these error paths. Signed-off-by: Li Qiong --- v1->v2: - Modify subject. - Resend patch and CC to linux-wireless. --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index db45da33adfd..b965649bb0e4 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -3553,6 +3553,7 @@ brcmf_notify_sched_scan_results(struct brcmf_if *ifp, WARN_ON(status != BRCMF_PNO_SCAN_COMPLETE); brcmf_dbg(SCAN, "PFN NET FOUND event. count: %d\n", result_count); if (!result_count) { + err = -EINVAL; bphy_err(drvr, "FALSE PNO Event. (pfn_count == 0)\n"); goto out_err; } @@ -3560,6 +3561,7 @@ brcmf_notify_sched_scan_results(struct brcmf_if *ifp, netinfo_start = brcmf_get_netinfo_array(pfn_result); datalen = e->datalen - ((void *)netinfo_start - (void *)pfn_result); if (datalen < result_count * sizeof(*netinfo)) { + err = -EINVAL; bphy_err(drvr, "insufficient event data\n"); goto out_err; } -- 2.11.0