a1311e0a49a722b5b6128a49bfdc2d6003ae93cf
[openwrt/staging/adrian.git] /
1 From 1524cbf3621576c639405e7aabeac415f9617c8d Mon Sep 17 00:00:00 2001
2 From: Adrian Ratiu <adrian.ratiu@collabora.com>
3 Date: Wed, 25 Sep 2019 16:44:57 +0300
4 Subject: [PATCH] brcmfmac: don't WARN when there are no requests
5
6 When n_reqs == 0 there is nothing to do so it doesn't make sense to
7 search for requests and issue a warning because none is found.
8
9 Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
10 Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
11 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
12 ---
13 drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c | 4 ++++
14 1 file changed, 4 insertions(+)
15
16 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
17 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
18 @@ -57,6 +57,10 @@ static int brcmf_pno_remove_request(stru
19
20 mutex_lock(&pi->req_lock);
21
22 + /* Nothing to do if we have no requests */
23 + if (pi->n_reqs == 0)
24 + goto done;
25 +
26 /* find request */
27 for (i = 0; i < pi->n_reqs; i++) {
28 if (pi->reqs[i]->reqid == reqid)