Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2820342rwe; Mon, 29 Aug 2022 00:11:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR49/FlodzcHLQWz/4D2lyjG1vKaJ8CaDjnEoXrSGglb682Y/MtCn2db81Y0VTCiROOPa8CS X-Received: by 2002:aa7:dbc5:0:b0:440:b0d6:7586 with SMTP id v5-20020aa7dbc5000000b00440b0d67586mr14876028edt.85.1661757098310; Mon, 29 Aug 2022 00:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661757098; cv=none; d=google.com; s=arc-20160816; b=Oq4Rmr3DIrUEUWsz4jxgq/W+Wvo3cjqXwZNJUhNVeytGkvEyxbIKB97O9dx2a3Xd1W E2Q2dO0230PbimYwmMoMuBY8KoKtEXx/dxc8jBp/n1ZNaPqU21xTN3L8Yi88uEZ1zqi/ 0EoW5wjjf/4nyrrthSPo9y3LX40XAQD05oVZwvbTsPGXogWvJww7IF73FQjyHb2Ilywd JhE2Teg3ZRRQ1uOVCxL6KkE9KY5+NF/7PG0+k7KjHllT7hkiP4uE3HUS7kyfq7mLb5pM dCmMKwHxPA1/eXiWEMmuY4W6dvzxiVzmtcbme+R+Hu4cGDeIVpP5iOKLSIDWDmJjawWl t9MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=NSyQuiePM6q0yWGWLwcyQqpwRchOAU05g+4anaHZxo4=; b=EAGu3YF+B5qYp4Ey0whvW4iG8Jxxt6RX0VU7vlle2TbN8l4z1aBvSLMWTgovmsT/kj YU2tAtOIriSNk8G7CbH+6GK5LSzybg25r601ner5/AJSmW5EUxA5Q2AzsfJ9139tHTvh erdU2uPZwuBpuQgfJlUUr7SsMxKh+QJ92O2T0MiFUmi72okMLHqDMKkWYcHkeKhL1ofT zbFr3j3jtNLQGKTzUnxz8thBxJ/PORkv3eskxWHuSIupS3wiyDuqvLB9U68Da1Mm5QnN KGi4Z5cgcyF739M6l4wR/p0vJr+tEuWsmWv1MAPhJLaGj77JVc1Gg+fz4Pk9DfP+vyWP /xCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 f8-20020a0564021e8800b004487e66b7d3si1303358edf.175.2022.08.29.00.11.13; Mon, 29 Aug 2022 00:11:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229475AbiH2HAB (ORCPT + 99 others); Mon, 29 Aug 2022 03:00:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbiH2G75 (ORCPT ); Mon, 29 Aug 2022 02:59:57 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B001F14019; Sun, 28 Aug 2022 23:59:55 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 6B7041E80D59; Mon, 29 Aug 2022 14:55:12 +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 HuvKuX657c9E; Mon, 29 Aug 2022 14:55:09 +0800 (CST) Received: from localhost.localdomain (unknown [180.167.10.98]) (Authenticated sender: liqiong@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 33B0B1E80D2C; Mon, 29 Aug 2022 14:55:08 +0800 (CST) From: Li Qiong To: Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , "David S . Miller" , Eric Dumazet , Jakub Kicinski Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yu Zhe , Li Qiong Subject: [PATCH] wifi: cfg80211: add error code in brcmf_notify_sched_scan_results() Date: Mon, 29 Aug 2022 14:58:31 +0800 Message-Id: <20220829065831.14023-1-liqiong@nfschina.com> X-Mailer: git-send-email 2.11.0 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-kernel@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 --- 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