2022-08-29 07:11:38

by Li Qiong

[permalink] [raw]
Subject: [PATCH] wifi: cfg80211: add error code in brcmf_notify_sched_scan_results()

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 <[email protected]>
---
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


2022-08-29 09:03:25

by Arend Van Spriel

[permalink] [raw]
Subject: Re: [PATCH] wifi: cfg80211: add error code in brcmf_notify_sched_scan_results()

On 8/29/2022 8:58 AM, Li Qiong wrote:
> The err code is 0 at the first two "out_err" paths, add error code
> '-EINVAL' for these error paths.

There is no added value provided in this change. There is an error
message, but it is otherwise silently ignored as there is no additional
fault handling required.

Regards,
Arend

> Signed-off-by: Li Qiong <[email protected]>
> ---
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 ++
> 1 file changed, 2 insertions(+)

2022-08-29 12:19:27

by Li Qiong

[permalink] [raw]
Subject: Re: [PATCH] wifi: cfg80211: add error code in brcmf_notify_sched_scan_results()



在 2022年08月29日 16:51, Arend Van Spriel 写道:
> On 8/29/2022 8:58 AM, Li Qiong wrote:
>> The err code is 0 at the first two "out_err" paths, add error code
>> '-EINVAL' for these error paths.
>
> There is no added value provided in this change. There is an error message, but it is otherwise silently ignored as there is no additional fault handling required.
It should be better to fix the return code, and It seems that the code has been checked, eg:
if (ifp->drvr->fweh.evt_handler[i]) {
.....
}


>
> Regards,
> Arend
>
>> Signed-off-by: Li Qiong <[email protected]>
>> ---
>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 ++
>> 1 file changed, 2 insertions(+)